Closed RickVerkuijlen closed 1 year ago
I've experienced this on more than one SDK right now. It also happens on the S3Client.
Next time, I need to take a closer look to the documentation: https://docs.aws.amazon.com/lambda/latest/dg/snapstart-activate.html#snapstart-credentials
Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
@RickVerkuijlen I am curious to get more details on the solution you put in place to fix your issue. As solution, did you add those variables as documented in https://docs.aws.amazon.com/lambda/latest/dg/snapstart-activate.html#snapstart-credentials? If yes, how did you determine the appropriate values for those variables? AWS_CONTAINER_CREDENTIALS_FULL_URI=http://localhost/get-credential AWS_CONTAINER_AUTHORIZATION_TOKEN=Basic abcd
Describe the bug
We want to fetch a value from the secretsmanager using the AWS SDK. When using the SecretsManagerClient with snapstart enabled, the client cannot find the AWS credentials. Other services (like the IotClient) do seem to find the credentials.
The bug is gone when snapstart is disabled.
Expected Behavior
The client should find the credentials that are used by the Lambda, like other SDK clients.
Current Behavior
software.amazon.awssdk.core.exception.SdkClientException: Unable to load credentials from system settings. Access key must be specified either via environment variable (AWS_ACCESS_KEY_ID) or system property (aws.accessKeyId). | Caused by: software.amazon.awssdk.core.exception.SdkClientException: Unable to load credentials from system settings. Access key must be specified either via environment variable (AWS_ACCESS_KEY_ID) or system property (aws.accessKeyId).
Reproduction Steps
Possible Solution
Same way of fetching AWS Credentials like the other SDK clients.
Additional Information/Context
No response
AWS Java SDK version used
2.19.19 (Also happens with latest version)
JDK version used
11
Operating System and version
Happens on AWS Lambda with Snapstart. Locally it works (MacOS)