Each entry in a change set is a ResourceChange with an Action (Add, Modify, Remove, Import, Dynamic); a Modify also has a Scope, Details giving each changed property's RequiresRecreation (Never, Conditionally or Always, as in the property's Update requires line), and a Replacement flag for the worst of them. False means an in-place update with the same physical ID; True means a new resource is created and the old one deleted, data and all; Conditional depends on values known only at deploy time, so treat it as True.
For the stage switch, TableName is a create-only property of AWS 24 ::DynamoDB 24 ::Table, so AWS reports "Replacement": "True" and a detail with "RequiresRecreation": "Always", and executing it creates booknest-prod-fn-books, repoints the stack and deletes the dev table with its data (not run here). LocalStack 4.13.1 63,725 computes something else:
CS=$(aws cloudformation list-change-sets --stack-name booknest-fn \
--query 'Summaries[0].ChangeSetId' --output text)
aws cloudformation describe-change-set --change-set-name "$CS" \
--query 'Changes[].ResourceChange'
aws cloudformation execute-change-set --change-set-name "$CS"
aws cloudformation wait stack-update-complete --stack-name booknest-fn
aws cloudformation describe-stacks --stack-name booknest-fn --output text \
--query 'Stacks[0].[StackStatus,Parameters[0].ParameterValue]'
aws dynamodb list-tables --output text[
{
"Action": "Modify",
"LogicalResourceId": "BooksTable",
"PhysicalResourceId": "booknest-dev-fn-books",
"ResourceType": "AWS::DynamoDB::Table",
"Replacement": "False"
}
]
UPDATE_COMPLETE prod
TABLENAMES booknest-dev-fn-booksIt called the change an in-place Modify with no details, and the update "completed" with Stage=prod while the table kept its dev name. On AWS, search every change set for "Replacement": "True" before executing, and give stateful resources an UpdateReplacePolicy (Deletion Policies); on LocalStack, check create-only properties yourself in the resource reference.