CJW
CJW

Reputation: 990

AWS CloudWatch Events - Get resource tags

I have got a AWS CloudWatch Event set-up to trigger whenever a resource is not compliant with a rule in AWS config.

This rule then triggers a Lambda that sends a notification to a general channel to inform people that a rule has been breached.

However, I would ideally like to make use of the tag attached to a resource (as each AWS resource is tagged with the team that owns it) to be able to route these notifications to more specific locations. However, the data sent to the Lambda by the Cloudwatch Event does not contain this information. Is there a good way I can get the tags attached to an AWS resource when an AWS Cloudwatch event is triggered?

Upvotes: 1

Views: 643

Answers (1)

Marcin
Marcin

Reputation: 238051

Sadly there is not. Your lambda would have to use AWS SDK to check the tags on the resource associated with the event, and then forward the event to different consumers, e.g. SQS queue, or custom EventBridge rule.

Upvotes: 1

Related Questions