aws icon indicating copy to clipboard operation
aws copied to clipboard

Cloudwatch Alarms

Open jfpaulin opened this issue 1 year ago • 4 comments

:frowning_person: Problem Statement

I'm currently changing the way I'm creating alarms in AWS Cloudwatch. I was using the AWS CLI but now I want to use this cookbook. The problem I have is that when I was creating alarms using CLI, I could set the value for "Missing data treatment" using this parameter here : --treat-missing-data breaching It does not seem to be possible right now using the latest cookbook's version.

:grey_question: Possible Solution

Maybe just adding a new property for the resource and use that property when creating the alarm.

Thanks for your help.

jfpaulin avatar Jan 10 '24 14:01 jfpaulin

:wave: I took a look and I think it might be supported, can you confirm if insufficient_data_actions is what you are looking for?

https://github.com/sous-chefs/aws/blob/v8.3.1/resources/cloudwatch.rb#L6

majormoses avatar Jan 10 '24 20:01 majormoses

Thanks for your answer, but no. Using insufficient_data_actions tells CloudWatch what action to take when the alarm falls into Insufficient data state.

--treat-missing-data breaching tells CloudWatch that when there is no data found, the alarm should be put in Alarm state.

Thanks again!

jfpaulin avatar Jan 10 '24 20:01 jfpaulin

I see; it looks like we would need to add treat_missing_data to the options in the section I linked above, with the possible values of (breaching | notBreaching | ignore | missing), and a default of missing based on your explanation and a quick review of https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/CloudWatch/Client.html. I am happy to review it if someone wants to take a crack at this.

majormoses avatar Jan 10 '24 21:01 majormoses

I would be happy to help. Can I contribute using the guidelines found here : https://github.com/chef-cookbooks/community_cookbook_documentation/blob/main/CONTRIBUTING.MD ?

jfpaulin avatar Jan 10 '24 21:01 jfpaulin