VpcEndpointService Tags cannot be added
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
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.
How do we open a CFN issue to resolve this? #9487 is also related to naming VpcEndpoints
File an issue here: https://github.com/aws-cloudformation/aws-cloudformation-coverage-roadmap, get a lot of people to +1 it.
Reported here: https://github.com/aws-cloudformation/aws-cloudformation-coverage-roadmap/issues/350
Same issue in CDK v2.
Yes @Chris-Cui,
We need CloudFormation support for this first See the issue linked by @wiget 🙂
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'}],
},
...
});
Is this resolved?