Skip to content

Conversation

ronanj2
Copy link

@ronanj2 ronanj2 commented Jul 29, 2025

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:

    • Added a new variable SKIP_DEFAULT_ALARMS_TAG in CloudWatchAutoAlarms.yaml to define the tag used to skip default alarms.
  • Environment Variable Support:

    • Introduced SKIP_DEFAULT_ALARMS_TAG as an environment variable in src/cw_auto_alarms.py to make the tag configurable.
  • Function Signature Updates:

    • Updated the scan_and_process_alarm_tags function in src/actions.py to accept the new skip_default_alarms_tag parameter.
  • Alarm Processing Logic:

    • Enhanced the logic in scan_and_process_alarm_tags to check for the Skip_Default_Alarms tag on EC2 instances. If the tag is present, default alarms are not created for that instance.
  • Lambda Handler Integration:

    • Modified calls to scan_and_process_alarm_tags in src/cw_auto_alarms.py to pass the skip_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%.

…level when create_default_alarms_flag is true at the global level.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant