AWS Certified Developer – Associate (DVA-C02) — Question 518
A team deploys an AWS CloudFormation template to update a stack that already included an Amazon DynamoDB table. However, before the deployment of the update, the team changed the name of the DynamoDB table on the template by mistake. The DeletionPolicy attribute for all resources has the default value.
What will be the result of this mistake?
Answer options
- A. CloudFormation will create a new table and will delete the existing table.
- B. CloudFormation will create a new table and will keep the existing table.
- C. CloudFormation will overwrite the existing table and will rename the existing table.
- D. CloudFormation will keep the existing table and will not create a new table.
Correct answer: A
Explanation
Changing the name of a DynamoDB table in a CloudFormation template requires a replacement of the resource. Because the DeletionPolicy is left at its default value of 'Delete', CloudFormation will create the new table first and then permanently remove the original table.