Closed j4zzcat closed 5 months ago
Thanks @j4zzcat for reaching out. it would be great if you could clarify why you expect adding tags by AWS for the resources.
All the other constructs I used so far added this tag - vpc, subnet, security group, route table, nat, ec2 instance, inbound resolver etc. With this tag, life's easy identifying resources of a particular stack.
Thanks for the response @j4zzcat . AFAIK, there are no default tags applied on resources. Tags are created by user via constructs in the app and once the code is synthesized, these are applied to all the AWS resources it deploys. Here is reference for the tags and how these can be implemented. Let me know if that helps clarify your question.
I can only say that when I'm using CDK to create resources, the tag aws:cloudformation:stack-name
is created on many of the resources, including, but not limited to, vpc, subnet, security group, route table, nat, ec2 instance and inbound resolver. Further, one cannot create tags prefixed with aws
- and so doesn't it mean that it's being done by AWS code somewhere? perhaps on a lower level like CloudFormation? See also 7930.
@j4zzcat , I re-checked the documentations for resource tags, but I am not sure why tags are not created with PrivateHostedZone resource. I will reach out to internal team to get it sorted. Thank you for reporting this.
Hey @j4zzcat , here is a doc that details out how cloudformation support adding tags to hostedZone, ,tags are implemented through interface HostedZoneTagProperty , as detailed out in this article -https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/services/route53/CfnHostedZone.html
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.route53.*;
CfnHostedZone cfnHostedZone = CfnHostedZone.Builder.create(this, "MyCfnHostedZone")
.hostedZoneConfig(HostedZoneConfigProperty.builder()
.comment("comment")
.build())
.hostedZoneTags(List.of(HostedZoneTagProperty.builder()
.key("key")
.value("value")
.build()))
.name("name")
.queryLoggingConfig(QueryLoggingConfigProperty.builder()
.cloudWatchLogsLogGroupArn("cloudWatchLogsLogGroupArn")
.build())
.vpcs(List.of(VPCProperty.builder()
.vpcId("vpcId")
.vpcRegion("vpcRegion")
.build()))
.build();
Please let me know if this works for you!
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.
Describe the bug
When creating a PrivateHostedZone, the resource is created but it is not tagged with the
aws:cloudformation:stack-name
tag.Expected Behavior
As any resource created with the CDK, a PrivateHostZone should be tagged with the
aws:cloudformation:stack-name
tag.Current Behavior
Resource not tagged.
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.65.0 (build 5862f7a)
Framework Version
No response
Node.js Version
v19.6.1
OS
macOS 13.1
Language
Java
Language Version
No response
Other information
No response