Skip to content
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

Improve/Fix documentation to correctly set "table name" for the Idempotency DynamoDB table for Powertool for v2 #1786

Open
1 task done
Vadym79 opened this issue Mar 4, 2025 · 1 comment
Labels
documentation Improvements or additions to documentation v2 Version 2

Comments

@Vadym79
Copy link

Vadym79 commented Mar 4, 2025

What were you searching in the docs?

In all examples for the v2 version (in preview) provided here Idempotency is configured like this:

Idempotency.config().withPersistenceStore(DynamoDBPersistenceStore.builder()
.withTableName(System.getenv("TABLE_NAME")).build()).configure();

where DynamoDB table name is retrieved from the environment variable with the name TABLE_NAME.

On the same documentation page, IaC example with AWS SAM to set this table name is defined in the environment variable IDEMPOTENCY_TABLE Lambda Function like this

IdempotencyFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: Function
Handler: helloworld.App::handleRequest
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref IdempotencyTable
Environment:
Variables:
IDEMPOTENCY_TABLE: !Ref IdempotencyTable

Is this related to an existing documentation section?

https://docs.powertools.aws.dev/lambda/java/preview/utilities/idempotency

How can we improve?

use environment variable with the name TABLE_NAME instead like this:
Environment:
Variables:
TABLE_NAME: !Ref IdempotencyTable

Got a suggestion in mind?

use environment variable with the name TABLE_NAME instead like this:
Environment:
Variables:
TABLE_NAME: !Ref IdempotencyTable

Acknowledgment

  • I understand the final update might be different from my proposed suggestion, or refused.
@Vadym79 Vadym79 added documentation Improvements or additions to documentation triage labels Mar 4, 2025
@Vadym79 Vadym79 changed the title Improve/Fix documentation to correctly set "table name" for the Idempotency DynamoDB table for v2 Improve/Fix documentation to correctly set "table name" for the Idempotency DynamoDB table for Powertool for v2 Mar 4, 2025
@phipag phipag added v2 Version 2 and removed triage labels Mar 6, 2025
@phipag phipag moved this from Triage to Backlog in Powertools for AWS Lambda (Java) Mar 6, 2025
@phipag
Copy link
Contributor

phipag commented Mar 6, 2025

Thanks for spotting this. We should make the usage of env variables more consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation v2 Version 2
Projects
Status: Backlog
Development

No branches or pull requests

2 participants