(logs): Adding Tags to LogGroups Construct Not working
See original GitHub issueDescription
I’m trying to add tags to a LogGroup and tags are not being added. Deployment is successful but not tags are added.
Reproduction Steps
const lg = new LogGroup(this, `lg`, {
logGroupName: `/aws/appsync/apis/${this.graphQLApi.attrApiId}`,
removalPolicy: RemovalPolicy.DESTROY,
});
Tags.of(lg).add('stringKey','stringValue');
What did you expect to happen?
Tags to be added to the log group
What actually happened?
No tags were added
Environment
- CDK CLI Version : 1.75.0
- Node.js Version: 12.x
- OS : MacOs
- Language (Version): typescript 4.0.3
Other
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 3 years ago
- Reactions:11
- Comments:7 (4 by maintainers)
Top Results From Across the Web
TagLogGroup - Amazon CloudWatch Logs
To list the tags for a log group, use ListTagsForResource. To remove tags, use UntagResource. For more information about tags, see Tag Log...
Read more >CDK not adding tags to resources - Stack Overflow
We contacted AWS, it turns out that Tags are not supported by Cloudformation for Log groups, and consequently it is not supported by...
Read more >Datadog Forwarder
Datadog Forwarder. The Datadog Forwarder is an AWS Lambda function that ships logs, custom metrics, and traces from your environment to Datadog.
Read more >aws_cloudwatch_log_group | Resources | hashicorp/aws
resource "aws_cloudwatch_log_group" "yada" { name = "Yada" tags = { Environment ... Cloudwatch Log Groups can be imported using the name , e.g.,...
Read more >AWS CloudWatch data source | Grafana documentation
Note: To troubleshoot issues while setting up the CloudWatch data source, check the /var/log/grafana/grafana.log file. Configure the data source. To access the ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Seems like support was added to CloudFormation for this, but it hasn’t been officially released yet due to some security review. https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-logs/pull/53
I assume once that goes through, support can be added to CDK without much difficulty?
Strangely adding tags to LogGroup is not supported by CloudFormation (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html) but it is possible to add tags through the API (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_TagLogGroup.html)