forked from michaellavelle/spring-data-dynamodb
-
Notifications
You must be signed in to change notification settings - Fork 141
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
How can I have dynamodb table name dynamically based on my env? #297
Comments
Hi You can achieve this by making a table name resolver
in the class where you are creating dynamo db bean just pass env value (the env value can be saved at application yml for respective environments)
and create a dbmapper like this
and now for table entities just provide the base name for the table and it will automatically append the env at the end of the table name. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected Behavior
I have my dev and stage env in one AWS region and I am using the suffix
_dev and _stage
to tables.Is there any way to add this suffix in runtime to @DynamoDBTable()?
Actual Behavior
I tried to override the value using TableNameResolver but the override method is not getting called. also, I tried with Spring expression to evaluate the expression but that is also not working.
Would appreciate any help. Thanks
The text was updated successfully, but these errors were encountered: