Skip to content

Instantly share code, notes, and snippets.

@JohnTheodore
Created December 18, 2017 22:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JohnTheodore/c495756644a2bc3c905fc71f91798242 to your computer and use it in GitHub Desktop.
Save JohnTheodore/c495756644a2bc3c905fc71f91798242 to your computer and use it in GitHub Desktop.
policies:
- name: ec2-email-about-scheduled-maintenance
resource: ec2
mode:
type: periodic
role: arn:aws:iam::{account_id}:role/custodian-lambda-role
schedule: rate(1 day)
filters:
- type: health-event
statuses:
- upcoming
- open
types:
- AWS_EC2_API_ISSUE
- AWS_EC2_BILLING_NOTIFICATION
- AWS_EC2_CLASSIC_NETWORK_HEALTH_INTERNET_ISSUE
- AWS_EC2_CLASSIC_NETWORK_HEALTH_INTER_AZ_ISSUE
- AWS_EC2_CLASSIC_NETWORK_HEALTH_INTRA_AZ_ISSUE
- AWS_EC2_DEDICATED_HOST_NETWORK_MAINTENANCE_SCHEDULED
- AWS_EC2_DEDICATED_HOST_POWER_MAINTENANCE_SCHEDULED
- AWS_EC2_DEDICATED_HOST_RETIREMENT_SCHEDULED
- AWS_EC2_DEDICATED_HOST_UNDER_RESERVATION_REPLACE
- AWS_EC2_DNS_RESOLUTION_ISSUE
- AWS_EC2_INSTANCE_AUTO_RECOVERY_FAILURE
- AWS_EC2_INSTANCE_AUTO_RECOVERY_NO_ACTION
- AWS_EC2_INSTANCE_AUTO_RECOVERY_SUCCESS
- AWS_EC2_INSTANCE_NETWORK_MAINTENANCE_SCHEDULED
- AWS_EC2_INSTANCE_POWER_MAINTENANCE_SCHEDULED
- AWS_EC2_INSTANCE_RETIREMENT_EXPEDITED
- AWS_EC2_INSTANCE_RETIREMENT_SCHEDULED
- AWS_EC2_INSTANCE_STORE_DRIVE_PERFORMANCE_DEGRADED
- AWS_EC2_NETWORK_CONNECTIVITY_ISSUE
- AWS_EC2_OPERATIONAL_ISSUE
- AWS_EC2_OPERATIONAL_NOTIFICATION
- AWS_EC2_PERSISTENT_INSTANCE_RETIREMENT_EXPEDITED
- AWS_EC2_PERSISTENT_INSTANCE_RETIREMENT_SCHEDULED
- AWS_EC2_POWER_CONNECTIVITY_ISSUE
- AWS_EC2_RI_MARKETPLACE_BANK_ACCOUNT_UPDATE_REQUIRED
- AWS_EC2_SYSTEM_REBOOT_MAINTENANCE_SCHEDULED
- AWS_EC2_VPC_NETWORK_HEALTH_INTERNET_ISSUE
- AWS_EC2_VPC_NETWORK_HEALTH_INTER_AZ_ISSUE
- AWS_EC2_VPC_NETWORK_HEALTH_INTRA_AZ_ISSUE
actions:
- type: notify
priority_header: '1'
template_format: html
email_ldap_username_manager: True
template: /custodian/email/jinja_template.j2
subject: "{{account}} - {{region}} - AWS EC2 resource(s) has an event!"
to:
- resource-owner
- ldap_uid_tags
- custodian@example.com
transport:
type: sqs
queue: https://sqs.us-east-1.amazonaws.com/12345/cloudcustodian-mailer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment