amplify-category-api icon indicating copy to clipboard operation
amplify-category-api copied to clipboard

How to rename DynamoDB tables in Gen 2?

Open AlexThomas90210 opened this issue 1 year ago • 11 comments

Amplify CLI Version

Gen 2

Question

I really like Amplify but I find the resource name excruciatingly annoying, specially when deploying multiple branches/sandboxes in one AWS Account.

I am trying to rename core resources, such as userpool, lambda function etc, and I want to do the same with DynamoDB table but I don't seem to be able to get the Cloudformation reference because its in a nested stack, is it possible?

// Rename resources
backend.auth.resources.cfnResources.cfnUserPool.userPoolName = `${namePrefix}-userpool`;
backend.auth.resources.cfnResources.cfnIdentityPool.identityPoolName = `${namePrefix}-identitypool`;

// I want to rename here 
// backend.data.resources.cfnResources.cfnTables["Example"].tableName = `${namePrefix}-example-table`;

backend.data.resources.cfnResources.cfnGraphqlApi.name = `${namePrefix}-gqlapi`;
backend.stripeFunction.resources.cfnResources.cfnFunction.functionName = `${namePrefix}-payments-handler`;
backend.stripeWebhookCustomResource.resources.cfnResources.cfnFunction.functionName = `${namePrefix}-stripe-webhook-handler`;

AlexThomas90210 avatar Oct 29 '24 20:10 AlexThomas90210