nerdexam
Amazon

DVA-C02 · Question #546

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

The correct answer is A. CloudFormation will create a new table and will delete the existing table.. When a DynamoDB table is renamed in a CloudFormation template, CloudFormation treats it as a resource replacement: it creates a new table with the new name and deletes the original, because the default DeletionPolicy is Delete.

Submitted by saadiq_pk· Mar 5, 2026Deployment

Question

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?

Options

  • ACloudFormation will create a new table and will delete the existing table.
  • BCloudFormation will create a new table and will keep the existing table.
  • CCloudFormation will overwrite the existing table and will rename the existing table.
  • DCloudFormation will keep the existing table and will not create a new table.

How the community answered

(23 responses)
  • A
    65% (15)
  • B
    4% (1)
  • C
    22% (5)
  • D
    9% (2)

Why each option

When a DynamoDB table is renamed in a CloudFormation template, CloudFormation treats it as a resource replacement: it creates a new table with the new name and deletes the original, because the default DeletionPolicy is Delete.

ACloudFormation will create a new table and will delete the existing table.Correct

CloudFormation identifies resources by their logical ID and physical name properties. Changing the table name causes CloudFormation to determine that the existing resource must be replaced. With the default DeletionPolicy of Delete, CloudFormation first creates the new table with the updated name and then deletes the old table, resulting in data loss.

BCloudFormation will create a new table and will keep the existing table.

Retaining the existing table requires explicitly setting DeletionPolicy to Retain; the default value is Delete, so the old table will be removed.

CCloudFormation will overwrite the existing table and will rename the existing table.

CloudFormation cannot rename a DynamoDB table in place; a name change triggers a full resource replacement, not an in-place update.

DCloudFormation will keep the existing table and will not create a new table.

CloudFormation will proceed to create the new table under the updated name; it does not silently skip resource creation when a name changes.

Concept tested: CloudFormation DeletionPolicy default behavior on resource replacement

Source: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html

Community Discussion

No community discussion yet for this question.

Full DVA-C02 Practice