Allow skipping the creation of default CloudWatch alarms for specific EC2 instances by using a new tag Skip_Default_Alarms #66
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new feature to allow skipping the creation of default CloudWatch alarms for specific EC2 instances by using a new tag,
Skip_Default_Alarms
. The changes involve adding support for this tag across the CloudFormation template, environment variables, and the alarm processing logic. Below are the key updates:Feature Addition: Support for Skipping Default Alarms
CloudFormation Template Update:
SKIP_DEFAULT_ALARMS_TAG
inCloudWatchAutoAlarms.yaml
to define the tag used to skip default alarms.Environment Variable Support:
SKIP_DEFAULT_ALARMS_TAG
as an environment variable insrc/cw_auto_alarms.py
to make the tag configurable.Function Signature Updates:
scan_and_process_alarm_tags
function insrc/actions.py
to accept the newskip_default_alarms_tag
parameter.Alarm Processing Logic:
scan_and_process_alarm_tags
to check for theSkip_Default_Alarms
tag on EC2 instances. If the tag is present, default alarms are not created for that instance.Lambda Handler Integration:
scan_and_process_alarm_tags
insrc/cw_auto_alarms.py
to pass theskip_default_alarms_tag
parameter.Note for the Reviewers:
In my Company/Org, we wanted to have the Default Alarms enabled globally - and created for almost all instances. However, there are instances where the default alarms are not suitable. For these instances, we are adding customized AutoAlarm tags instead e.g. alarming for 90% CPU rather than the default of 80%.