Skip to content

synapsestudios/terraform-aws-ecs-cloudwatch-alerts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cloudwatch Alert Module

These generate alarms that can be monitored by EventBridge to allow notification through SNS Topics to an alerting software, or directly through a pre-existing SNS topic

https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html

https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/US_SetupSNS.html

Requirements

No requirements.

Providers

Name Version
aws n/a

Modules

No modules.

Resources

Name Type
aws_cloudwatch_metric_alarm.cpu-utilization-alarm resource
aws_cloudwatch_metric_alarm.task-count-alarm resource
aws_sns_topic_subscription.sns-subscription resource

Inputs

Name Description Type Default Required
alert_email Specify the email you'd like the alerts to go to (Unneccessary if create_sns_subscription is false) string "alerts@synapsestudios.com" no
cluster_name Cluster name of ECS service to be alerted on (Example: service-production) string "service-production" no
cpu_utilization_threshold Desired CPU Utilization threshold that will be compared in alert (Example: 90 for 90% average over 60 seconds in ECS Service) string "90" no
create_sns_subscription Set to true to create a sns subscription to the topic for created alarms bool true no
desired_task_threshold Desired task threshold that will be compared in alert (Example: 1 for alerts below 1 running task in ECS Service) string "1" no
env Specify the environment you're deploying to (Example: staging, dev, test) (leave null for production) string null no
service_name Service name of ECS service to be alerted on (Example: appname-api, appname-job_queue) string "appname-api" no
sns_arn Full arn of the desired sns topic to subscribe alarm to (Example: arn:aws:sns:region-name:XXXX:cloudwatch-topic) string "arn:aws:sns:region-name:XXXX:cloudwatch-topic" no
use_sns Use SNS for notifications bool true no

Outputs

Name Description
cloudwatch_alarm_cpu_arn Output aws cloudwatch alarm arn
cloudwatch_alarm_cpu_id n/a
cloudwatch_alarm_task_arn n/a
cloudwatch_alarm_task_id n/a