(aws-cloudwatch-actions): LambdaAction fails if added to multiple action types #29514
Labels
@aws-cdk/aws-cloudwatch-actions
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p2
Describe the bug
Adding the same lambda as the action for multiple status changes (alarm, ok, insufficient data) causes an error because of logical id conflicts.
Expected Behavior
I expect to be able to add the same lambda for multiple action types on a CloudWatch alarm.
Current Behavior
Reproduction Steps
Possible Solution
In the LambdaAction
bind
function, check if a permission with the same logical id has been added to the lambda using thethis.lambdaFunction.permissionsNode.tryFindChild(idPrefix)
function.Additional Information/Context
No response
CDK CLI Version
2.126.0 (build fb74c41)
Framework Version
No response
Node.js Version
v18.18.0
OS
macOS Ventura Version 13.6.4 (22G513)
Language
TypeScript
Language Version
5.3.3
Other information
No response
The text was updated successfully, but these errors were encountered: