- Newest
- Most votes
- Most comments
Solved this by moving the lambda out of the VPC. I first tried setting up the endpoint for secretsmanager, with a fully open security group, but this didn't work either.
The issue you're experiencing with retrieving secrets from AWS Secrets Manager using the AWS SDK for Rust appears to be related to network connectivity or configuration problems. The error message indicates a dispatch failure due to a timeout when trying to connect to the Secrets Manager service.
Here are a few things to check and try:
-
VPC Configuration: If your Lambda function is running in a VPC, ensure that it has proper network connectivity to reach AWS services. This typically involves setting up a NAT Gateway or VPC endpoints for Secrets Manager.
-
Security Groups and Network ACLs: Verify that the security groups and network ACLs associated with your Lambda function allow outbound traffic to the Secrets Manager service.
-
DNS Resolution: Make sure that DNS resolution is working correctly within your VPC. The error message suggests that the service endpoint couldn't be reached, which could be due to DNS issues.
-
Timeouts: The default timeout for the SDK might be too short. You could try increasing the timeout in your SDK configuration.
-
Region Configuration: Double-check that the region you're specifying ("eu-west-1") is correct and matches the region where your secret is stored.
-
IAM Permissions: Although you mentioned permissions are as open as possible, it's worth double-checking that the IAM role associated with your Lambda function has the necessary permissions to access Secrets Manager.
-
VPC Endpoints: If you're using VPC endpoints for Secrets Manager, ensure they are correctly configured and associated with the right subnets.
The debug log showing "0 B/s" throughput is indeed concerning and suggests that no data is being transferred. This could be due to network connectivity issues or potentially a bug in the SDK.
If none of these suggestions resolve the issue, you may want to consider:
-
Testing with a different SDK version or even a different programming language to isolate whether it's a Rust SDK-specific issue.
-
Using AWS X-Ray for more detailed tracing of the request to pinpoint where exactly the timeout is occurring.
-
Reaching out to AWS support or filing a bug report with the AWS SDK for Rust team if you suspect it might be a bug in the SDK itself.
Sources
Handling errors in the AWS SDK for Rust - AWS SDK for Rust
AWS Glue Secrets Manager - Network unreachable | AWS re:Post
Can't get XRay traces to work. Get error messages Role AROASDFTK3FXTEUSIJVRM trusts too many services, expected only 1. but this role does not exist in my IAM..
