feat(cloudwatch-actions): support alarm lambda action#28484
feat(cloudwatch-actions): support alarm lambda action#28484mergify[bot] merged 32 commits intoaws:mainfrom
Conversation
aws-cdk-automation
left a comment
There was a problem hiding this comment.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
|
Waiting #28542 merged. |
0fefaed to
d2e6e06
Compare
…ub.com/neilkuan/aws-cdk into support-cloudwatch-alarm-lambda-action
|
hi @go-to-k cloud you help review this PR ?! |
...ws-cdk-testing/framework-integ/test/aws-cloudwatch-actions/test/integ.lambda-alarm-action.ts
Outdated
Show resolved
Hide resolved
…ub.com/neilkuan/aws-cdk into support-cloudwatch-alarm-lambda-action
paulhcsun
left a comment
There was a problem hiding this comment.
Overall this looks good to me, could you just add a description to the example in the README please?
Pull request has been modified.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
| * @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricAlarm.html | ||
| */ | ||
| bind(_scope: Construct, _alarm: cloudwatch.IAlarm): cloudwatch.AlarmActionConfig { | ||
| this.lambdaFunction.addPermission('AlarmPermission', { |
There was a problem hiding this comment.
Why is the id not generated? Using static value AlarmPermission prohibits using the same lambda for multiple actions.
Something like this
const lambdaAction = () => new awsCloudWatchActions.LambdaAction(lambda);
alarmConcurrentLambdasMaximumReached.addAlarmAction(lambdaAction());
alarmRdsCpuUtilizationMaximumReached.addAlarmAction(lambdaAction());
leads to following error:
throw new Error(`There is already a Construct with name '${childName}' in ${typeName}${name.length > 0 ? ' [' + name + ']' : ''}`);
^
Error: There is already a Construct with name 'AlarmPermission' in NodejsFunction [...]
There was a problem hiding this comment.
I see. I have submitted a PR, so please wait a little longer.
There was a problem hiding this comment.
Awesome, thanks for your very fast support!
There was a problem hiding this comment.
Thanks! If you could upvote in the PR, the review may be prioritized.
feat(cloudwatch-action): support alarm lambda action
Closes #28483
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license