Skip to content

(aws-cloudwatch) Support cross-account alarms #15959

@faizalsomani

Description

@faizalsomani

Amazon Cloudwatch just announced cross account alarms. Account Id can be added to the alarm using the GUI in AWS account. However, cdk does not support use of region and account id when creating the alarm.

Reproduction Steps

private var metricLine = Metric.Builder.create()
            .metricName("ConcurrentExecutions")
            .namespace("AWS/Lambda")
            .statistic("Maximum")
            .region(<REGION>)
            .account(<ACCOUNT_ID>)
            .build()

// The alarm created here will NOT be for <REGION> and <ACCOUNT_ID>, however it will be created for the account CFN is deployed in
private var alarmWidget = Alarm.Builder.create(scope,<NAME>)
                        .metric(metricLine)
                        .alarmName(<NAME>)
                        .threshold(<THRESHOLD>)
                        .evaluationPeriods(<EVALUATION_PERIOD>)
                        .build()

What did you expect to happen?

Alarm should be created for the <REGION> and <ACCOUNT_ID> specified in metricLine.

What actually happened?

Alarm created was for the account the CFN was deployed to.


This is 🐛 Bug Report

Metadata

Metadata

Assignees

Labels

@aws-cdk/aws-cloudwatchRelated to Amazon CloudWatcheffort/smallSmall work item – less than a day of effortfeature-requestA feature should be added or improved.p1

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions