Skip to content
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

(aws-cloudwatch-actions): Add the possibility to have SSM OpsItem Action #16861

Closed
1 of 2 tasks
vportascarta opened this issue Oct 7, 2021 · 4 comments · Fixed by #16923
Closed
1 of 2 tasks

(aws-cloudwatch-actions): Add the possibility to have SSM OpsItem Action #16861

vportascarta opened this issue Oct 7, 2021 · 4 comments · Fixed by #16923
Labels
@aws-cdk/aws-cloudwatch-actions effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2

Comments

@vportascarta
Copy link
Contributor

Description

In addition to these actions : ApplicationScalingAction, AutoScalingAction, Ec2Action, Ec2InstanceAction, SnsAction, add an SystemManagerAction to be able to create OpsItem in SSM in a CW alarm.

Use Case

We need this to group and prioritize all our alarm triggers into OpsCenter instead of using SNS notification.

Proposed Solution

Add an action that build and add the arn into the alarm "arn:aws:ssm:<region>:<account_id>:opsitem:<severity>#CATEGORY=<category>"
Maybe use enum for severity and category

Other information

On AWS Console UI
image

Acknowledge

  • I may be able to implement this feature request
  • This feature might incur a breaking change
@madeline-k
Copy link
Contributor

Thanks for opening this feature request, @vportascarta! I think this would be a great feature to have. To implement, we need to add another action in the aws-cloudwatch-actions module here: https://github.com/aws/aws-cdk/tree/master/packages/%40aws-cdk/aws-cloudwatch-actions/lib.
If you are willing to open a PR that would be great! Take a look at our contributing guide to get started.

In the meantime, you can add the action arn to an Alarm using an escape hatch. Your code could look something like this, where scope is the relevant scope, it probably would be this:

  const cfnAlarm = Node.of(alarm).defaultChild as cloudwatch.CfnAlarm;
  cfnAlarm.alarmActions?.push(`arn:aws:ssm:${Stack.of(scope).region}:${Stack.of(scope).account}:opsitem:<severity>#CATEGORY=<category>`);

@madeline-k madeline-k added effort/small Small work item – less than a day of effort p2 and removed needs-triage This issue or PR still needs to be triaged. labels Nov 24, 2021
@madeline-k madeline-k removed their assignment Nov 24, 2021
@vportascarta
Copy link
Contributor Author

Hi @madeline-k, the PR is already done #16923.
Please let me know if it needs something else to implement this feature.

@madeline-k
Copy link
Contributor

Thanks for the PR, @vportascarta! Sorry I completely missed that when I was looking at this issue yesterday.

@mergify mergify bot closed this as completed in #16923 Feb 1, 2022
mergify bot pushed a commit that referenced this issue Feb 1, 2022
…#16923)

This small PR will add SSM OpsItem action to cloudwatch alarm.
The arn format was taken from the alarm UI (in view source) and with all the parameters (severity and category)

closes #16861 

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

github-actions bot commented Feb 1, 2022

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this issue Feb 21, 2022
…aws#16923)

This small PR will add SSM OpsItem action to cloudwatch alarm.
The arn format was taken from the alarm UI (in view source) and with all the parameters (severity and category)

closes aws#16861 

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-cloudwatch-actions effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants