Description
Use case
I was trying to implement the basic example using Terraform to deploy the Lambda and DynamoDB. However, I had forgotten to include the policy for the Lambda to talk to DynamoDB and kept getting the following error:
[ERROR] IdempotencyPersistenceLayerError: Failed to save in progress record to idempotency store
Traceback (most recent call last):
File "/var/task/aws_lambda_powertools/middleware_factory/factory.py", line 134, in wrapper
response = middleware()
File "/var/task/aws_lambda_powertools/utilities/idempotency/idempotency.py", line 79, in idempotent
return idempotency_handler.handle()
File "/var/task/aws_lambda_powertools/utilities/idempotency/base.py", line 97, in handle
return self._process_idempotency()
File "/var/task/aws_lambda_powertools/utilities/idempotency/base.py", line 116, in _process_idempotency
raise IdempotencyPersistenceLayerError("Failed to save in progress record to idempotency store") from exc
Each error message is the same which isn't entirely helpful. So I dug through the code and could see that it was exception chaining, but that also wasn't particularly helpful. It wasn't until I tried to implement the basic example using AWS SAM that I was able to see the policy that I'd forgotten to attach.
Solution/User Experience
Ideally, something in the error chain would receive a bad permissions error and that information would percolate up to the user. Every other time I deploy into AWS I get clear permissions errors and the reason I didn't even consider a permissions issue is because it was always so clear previously when that was it.
Alternative solutions
No response
Acknowledgment
- This feature request meets Lambda Powertools Tenets
- Should this be considered in other Lambda Powertools languages? i.e. Java, TypeScript