#746 made the CloudFormation deployer stamp aws:cloudformation:stack-name,
aws:cloudformation:stack-id and aws:cloudformation:logical-id on the resources it
creates, scoped to EC2. A stack's S3 bucket, DynamoDB table, Lambda function, SQS queue or
ELBv2 load balancer still carries no stamp, so a policy or a test conditioning on
aws:ResourceTag/aws:cloudformation:stack-name sees the EC2 resources of a stack and not the
rest of it.
EC2 was the first cut for a specific reason rather than convenience: ec2TaggableResource
resolves a physical ID to a state key by prefix, so all nine EC2 types the deployer creates
were covered by one call, and EC2 is what AWS's own
ManagedCloudformationResourcesCleanupPolicy conditions on. Every other service needs its
own resolver:
So the work is one physical-ID → tag-store resolver per service, plus the decision of what to
do for a service that models no tags — skip silently, as EC2 does for an unresolvable ID, or
add the store.
StackDeployer.stampCFNResourceTags is the single call site and needs no restructuring: it
already runs for every deployed resource and returns early when the physical ID resolves to
nothing.
Acceptance criteria
Carved out of #746 (v0.109.0).
#746 made the CloudFormation deployer stamp
aws:cloudformation:stack-name,aws:cloudformation:stack-idandaws:cloudformation:logical-idon the resources itcreates, scoped to EC2. A stack's S3 bucket, DynamoDB table, Lambda function, SQS queue or
ELBv2 load balancer still carries no stamp, so a policy or a test conditioning on
aws:ResourceTag/aws:cloudformation:stack-namesees the EC2 resources of a stack and not therest of it.
EC2 was the first cut for a specific reason rather than convenience:
ec2TaggableResourceresolves a physical ID to a state key by prefix, so all nine EC2 types the deployer creates
were covered by one call, and EC2 is what AWS's own
ManagedCloudformationResourcesCleanupPolicyconditions on. Every other service needs itsown resolver:
So the work is one physical-ID → tag-store resolver per service, plus the decision of what to
do for a service that models no tags — skip silently, as EC2 does for an unresolvable ID, or
add the store.
StackDeployer.stampCFNResourceTagsis the single call site and needs no restructuring: italready runs for every deployed resource and returns early when the physical ID resolves to
nothing.
Acceptance criteria
aws:cloudformation:*tags, observable through that service's own tag-reading call.no new bookkeeping on
DeployedResource.resource, and the omission is named in
docs/services.md.aws:ResourceTag/…, and each service's own prefixwhere AWS publishes one) evaluate against them.
Carved out of #746 (v0.109.0).