aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

VpcEndpointService Tags cannot be added

Open holomekc opened this issue 5 years ago • 7 comments

Currently it seems impossible to add tags to a VpcEndpointService. We are using CDK Java.

Reproduction Steps

final VpcEndpointService vpcEs = VpcEndpointService.Builder.create(this, "test")...build();

Tag.add(vpcEs, "Name", "Test");
Tag.add(vpcEs, "x", "y");

Error Log

No error. It just does not work.

Environment

  • CLI Version: 1.18.21
  • Framework Version: 1.44
  • Node.js Version: 10.16.3
  • OS : Windows 10
  • Language (Version): Java (8)

Other

We wanted to set Name because it also seems not possible to set the name of a VpcEndpointService


This is :bug: Bug Report

holomekc avatar Jun 10 '20 08:06 holomekc

I think it is my bad. I did not check CloudFormation: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpcendpoint.html

Looks like that it is currently not supported to set Tags in the template although the UI does allow it.

holomekc avatar Jun 10 '20 16:06 holomekc

How do we open a CFN issue to resolve this? #9487 is also related to naming VpcEndpoints

flemjame-at-amazon avatar Aug 13 '20 14:08 flemjame-at-amazon

File an issue here: https://github.com/aws-cloudformation/aws-cloudformation-coverage-roadmap, get a lot of people to +1 it.

rix0rrr avatar Aug 18 '20 07:08 rix0rrr

Reported here: https://github.com/aws-cloudformation/aws-cloudformation-coverage-roadmap/issues/350

wiget avatar Oct 13 '20 15:10 wiget

Same issue in CDK v2.

chrcc avatar Apr 04 '22 03:04 chrcc

Yes @Chris-Cui,

We need CloudFormation support for this first See the issue linked by @wiget 🙂

peterwoodworth avatar Jun 21 '22 20:06 peterwoodworth

As a workaround, you can create a custom resource that calls the ec2:CreateTags API. For example:

new AwsCustomResource(stack, `VpcEndpointServiceTagCustomResource`, {
    onCreate: {
        service: 'EC2',
        action: 'createTags',
        parameters: {
            Resources: [testVpcEndpointService.vpcEndpointServiceId],
            Tags: [{Key: 'Name', Value: 'TestName'}],
        },
    ...
});

jsicheng avatar Oct 18 '24 05:10 jsicheng

Is this resolved?

pv-rudger avatar May 26 '25 06:05 pv-rudger