-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LambdaAction fails if same Lambda added to multiple alarms #30264
Comments
@dfserrano , I see this issue was reported here and fixed by this PR. As per the expectation and the intention of keeping the flag enabled is described here - Ref
Please feel free to reach out if this is not helpful or anything is misunderstood. |
Does it mean that the intention of Lambda actions is that users create one Lambda function per Alarm? |
Ran into this as well. |
@dfserrano ,the Alarm requires a Lambda ARN to invoke. If there are 100 Alarms, same Lambda ARN could be used -
|
The problem is that without that flag, then the
will have a collision when trying to add the second permission. By default, the flag that enables the desired functionality is not set. My question is whether having that flag off by default is the intended behavior or if it should be on by default. Additionally, using the same example I used before, attempting to add a lambda action to 100 alarms results in 100 new resources being created, one for each alarm-lambda permission. This may reach the CloudFormation stack resource limit per stack (if I end up with more than 500). As a workaround, I created a composite alarm containing all the child alarms I wanted to trigger the lambda. Then I updated my lambda function to extract extra information from those child alarms. This avoids hitting the stack resource limit but requires additional logic in the lambda. |
@dfserrano, by default, the flag is not set. As mentioned in this readme , here is a snippet for the flag value mentioned - |
@dfserrano Good morning. Please let us know if you are still blocked due to this issue. Thanks, |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Describe the bug
Adding the same lambda as the action for multiple alarms causes an error because of logical id conflicts. The error says
There is already a Construct with name 'AlarmPermission' in Function
Expected Behavior
One Lambda function can be configured as action for multiple alarms without the need to use the context
@aws-cdk/aws-cloudwatch-actions:changeLambdaPermissionLogicalIdForLambdaAction
Current Behavior
There is already a Construct with name 'AlarmPermission' in Function
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.140.0
Framework Version
No response
Node.js Version
18
OS
Mac
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: