question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(logs): Adding Tags to LogGroups Construct Not working

See original GitHub issue

Description

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:closed
  • Created 3 years ago
  • Reactions:11
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
rittnejecommented, Oct 18, 2021

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?

3reactions
swar8080commented, Jan 29, 2021

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)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found