bug: CloudFormation AWS::EC2::Instance drops Tags from the created instance #83
Replies: 1 comment
|
Retested the unchanged minimal reproduction on the unmodified
Direct EC2 The equivalent CloudFormation This used the normal licensed entrypoint with no added extensions, adapters, or init scripts. The stack and both instances were deleted after the comparison. Successful execution and cleanup do not mean the CloudFormation checks passed. |
Uh oh!
There was an error while loading. Please reload this page.
AWS::EC2::Instance.Properties.Tagsare present in the submitted template, but absent from the instance returned byDescribeInstancesafter the stack reachesCREATE_COMPLETE. A directRunInstancescontrol with equivalentTagSpecificationspreserves both tags.Tested with an unmodified
localstack/localstack-pro:devimage on Linux amd64, resolved on 2026-10-21 to:localstack/localstack-pro@sha256:722b9ef554f91eedf9416b4efb4d0581177073b7c890679594b6d52b3ee186e4Image creation time:
2026-10-21T12:09:05.228977792Z. The reproduction usesEC2_VM_MANAGER=mock, no extensions, no initialization hooks, and no source patches. All AWS calls use the local endpoint and dummy credentials.Start a disposable container with your own LocalStack Pro auth token:
Then run the following script in that container. It selects an available x86_64 AMI and a default subnet with
MapPublicIpOnLaunch=true, creates one direct EC2 instance and one CloudFormation-owned instance, compares the exact instance IDs, and removes both through the normal APIs.Expected
The instance created by CloudFormation should retain
Name=cfn-ec2-reproandReproduction=true, matching the direct EC2 control.Observed
The direct instance has both requested tags. The CloudFormation-owned instance has neither requested tag. Both instances are running, and each observation uses the exact instance ID returned by its owning API. This comparison concerns the two explicit resource tags, not generated
aws:cloudformation:*tags.Focused result from the stock-image comparison:
{ "direct": { "state": "running", "tags": { "Name": "cfn-ec2-repro", "Reproduction": "true" } }, "cloudformation": { "state": "running", "tags": {} } }The reproduced instances and stacks were deleted through the ordinary EC2/CloudFormation APIs, and the disposable container was removed. To remove your reproduction container:
All reactions