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

feat: allow overwrite table name #2464

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

pavinthan
Copy link

Description of changes

Allow overwritable DynamoDB table name

Issue #, if available

N/A

Description of how you validated changes

  1. Test in sample app

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)
  • New AWS SDK calls or CloudFormation actions have been added to relevant test and service IAM policies
  • Any CDK or CloudFormation parameter changes are called out explicitly

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@pavinthan pavinthan requested a review from a team as a code owner April 16, 2024 11:36
@pavinthan pavinthan changed the title feat: allow override table name feat: allow overwrite table name Apr 16, 2024
@renebrandel
Copy link
Contributor

@pavinthan - overriding the table name like this could be tricky to maintain long-term. Are there alternatives, you've potentially explored using the amplifyApi.resources.cfnResources?

Separately, we're currently working on a feature to allow you to describe you model but "point to an existing DynamoDB table". I think that might setup the same use case as you're trying to solve here.

@pavinthan
Copy link
Author

pavinthan commented Apr 17, 2024

@renebrandel, thanks for the feedback! I’m excited about the feature to link models to existing DynamoDB tables, but I still see a unique value in allowing custom table names right from the start—especially for new projects without existing tables. This avoids the need for additional CDK apps or tools.

On the concern about name conflicts across different environments, like multiple sandboxes in the same region, I suggest leveraging the cfnTables in cfnResources. We could allow users to include Amplify-specific identifiers (appID, branch name, sandbox identifier, and environment name) from defineBackend in their table names. This would enable a flexible yet standardized naming convention.

Incorporating this feature would give us tighter control over resource naming from the get-go, making projects easier to manage as they grow.

@pavinthan pavinthan changed the title feat: allow overwrite table name `lnb  xc\ lm Apr 18, 2024
@pavinthan pavinthan changed the title `lnb  xc\ lm feat: allow overwrite table name Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants