Skip to content

ListTagsForResource

Source: src/AWS/CloudWatch/ListTagsForResource.ts

Runtime binding for cloudwatch:ListTagsForResource — read the tags on a bound CloudWatch resource (alarm, dashboard, metric stream, insight rule, or mute rule); the resource ARN is injected automatically.

Provide CloudWatch.ListTagsForResourceHttp on the hosting Lambda Function to satisfy the requirement.

// init — grants cloudwatch:ListTagsForResource on the alarm's ARN
const listTagsForResource = yield* AWS.CloudWatch.ListTagsForResource(alarm);
// runtime
const result = yield* listTagsForResource();
const tags = result.Tags ?? [];