Skip to content

Instantly share code, notes, and snippets.

@Raghucheeti
Raghucheeti / cloudwatch_setup.sh
Created June 25, 2019 01:35 — forked from sylwit/cloudwatch_setup.sh
Setup cloudwatch alarms with lambda function
# Create EC2 instance, EBS alarms for all resources in a region
import os
import boto3
# SNS Topic Definition for EC2, EBS
instance_ids = os.environ.get('INSTANCE_ID').split('#')
ec2_sns = os.environ.get('SNS_TOPIC_ARN') # arn:aws:sns:ca-central-1:476697408772:cloudwatch-monitoring
ebs_sns = os.environ.get('SNS_TOPIC_ARN') # arn:aws:sns:ca-central-1:476697408772:cloudwatch-monitoring
# AWS Account and Region Definition for Reboot Actions