-
Notifications
You must be signed in to change notification settings - Fork 90
Credentials Provider bug with powertools-idempotency and Lambda SnapStart #1160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Just looked at the code, and confirmed issue in: powertools-idempotency/src/main/java/software/amazon/lambda/powertools/idempotency/persistence/DynamoDBPersistenceStore.java The code is explicitly using the environment credentials provider. |
Thanks for reporting this. Before the fix is released you can create your own For example: Idempotency.config().withConfig(
IdempotencyConfig.builder()
.withEventKeyJMESPath("powertools_json(body).address")
.build())
.withPersistenceStore(
DynamoDBPersistenceStore.builder()
.withDynamoDbClient(client)
.withTableName(System.getenv("IDEMPOTENCY_TABLE"))
.build()
).configure(); |
@mhermus, it would be good to chat about the fix if possible msailes at amazon dot co dot uk |
Brilliant, thanks! I didn't catch that option. |
fixed in #1161 |
Released in 1.16.0 |
Hi! While using version 1.15.0 of powertools-idempotency and java11 Lambda runtime, I started using AWS SnapStart and my function broke (previously working fine). I suspect it is an issue with the credentials provider chain not using the container provider like the default chain is supposed to (which I understand is required to work with SnapStart). As a result, it currently seems impossible to use this library with SnapStart, as I cannot seem to override the credentials provider.
The error message below seems to clearly indicate this. NOTE: the exception looks like it went to System.out - in other words, it isn't a Log4J log message.
EDIT: I looked in the persistence code and found this, which seems to confirm my suspicions:
in: DynamoDBPersistenceStore.java
Expected Behavior
The idempotency library works with AWS SnapStart as normal.
Current Behavior
The runtime cannot find credentials and therefore fails to write records to DynamoDB.
Possible Solution
Fix code to use default credentials provider chain that includes the container provider?
Steps to Reproduce (for bugs)
I suspect any SnapStart enabled Lambda will have this issue, but if not that would be great to know.
Environment
The text was updated successfully, but these errors were encountered: