aws / aws/aws-cdk

(aws-cloudwatch) CompositeAlarm uses static alarmName

Open Beginner friendly
#38,057 2 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-cloudwatch bug effort/medium p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
1d 19h
Merged PRs (30d)
71

Description

### Describe the bug

CompositeAlarm uses a template-static physical resource name, rather than allowing CloudFormation to generate one.

This can result in deployment failures when the same template is deployed multiple times into the same account (e.g., using ServiceCatalog).

### Regression Issue

- [ ] Select this option if this issue appears to be a regression.

### Last Known Working CDK Library Version

_No response_

### Expected Behavior

CDK generated template omits `AlarmName` entirely.

### Current Behavior

CDK generated template includes `AlarmName` property.

### Reproduction Steps

Create any CDK app including CompositeAlarm.

### Possible Solution

_No response_

### Additional Information/Context

For impacted users there is a relatively easy workaround: use CDK escape hatch to override and delete the property.

### AWS CDK Library version (aws-cdk-lib)

2.1125.0 (build 71fd29e)

### AWS CDK CLI version

2.1106

### Node.js Version

v24.16.0

### OS

Fedora 43

### Language

Python

### Language Version

Python 3.11.15

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by locating the CompositeAlarm implementation and its generated CloudFormation template in the aws-cloudwatch library. Reproduce the issue with a CDK app containing a CompositeAlarm, then verify that the synthesized template omits AlarmName and that repeated deployments no longer require a static physical name.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.