Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS::ElasticLoadBalancingV2::TargetGroup resources don’t receive the aws:cloudformation built-in tags / default AutoTags #1435

Open
rgoltz opened this issue Dec 7, 2022 · 1 comment
Labels

Comments

@rgoltz
Copy link

rgoltz commented Dec 7, 2022

Name of the resource

AWS::ElasticLoadBalancingV2::TargetGroup

Resource Name

No response

Issue Description

To find the right CloudFormation Stack, where a AWS resource is defined/maintained aws:cloudformation:* built-in tags are needed. This is an important function in day-to-day business.

Expected Behavior

All stack resources of type AWS::ElasticLoadBalancingV2::TargetGroup should automatically receive the aws:cloudformation:* built-in tags / automatic default CFN AutoTags.

Furthermore those aws:cloudformation:* built-in tags must be handled by CloudFormation Drift-Detection correctly (hence, aws:cloudformation:* tags are not a drift)

Observed Behavior

When you have an AWS::ElasticLoadBalancingV2::TargetGroup resource in your stack, it does not get assigned the built-in tags: aws:cloudformation:stack-name, aws:cloudformation:logical-id and aws:cloudformation:stack-id

Test Cases

deploy a stack containing this resource named above (e.g. sample from AWS docs) and check the tags on the console. You can't see aws:cloudformation:* built-in tags.

Other Details

split from #458 (comment) for better viewability

@greg5123334
Copy link

Confirmed. No service-managed tags added to AWS::ElasticLoadBalancingV2::TargetGroup resource.

Test code

        lb = elbv2.ApplicationLoadBalancer(self, "LB",
                                           vpc=vpc,
                                           internet_facing=True
                                           )

        asg = autoscaling.AutoScalingGroup(self, "ASG",
                                           vpc=vpc,
                                           instance_type=ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2,
                                                                             ec2.InstanceSize.MICRO),
                                           machine_image=ec2.AmazonLinuxImage()
                                           )

        listener = lb.add_listener("Listener",
                                   port=80,

                                   # 'open: true' is the default, you can leave it out if you want. Set it
                                   # to 'false' and use `listener.connections` if you want to be selective
                                   # about who can access the load balancer.
                                   open=True
                                   )

        # Create an AutoScaling group and add it as a load balancing
        # target to the listener.
        listener.add_targets("ApplicationFleet",
                             port=8080,
                             targets=[asg]
                             )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Coming Soon
Development

No branches or pull requests

2 participants