Skip to content

Latest commit

 

History

History
73 lines (57 loc) · 6.15 KB

File metadata and controls

73 lines (57 loc) · 6.15 KB

Requirements

Requirements

Name Version
terraform >=1.3

Providers

Providers

Name Version
aws 6.35.1

Resources

Resources

Name Type
aws_cloudwatch_log_group.application_logs resource
aws_cloudwatch_metric_alarm.custom resource
aws_cloudwatch_metric_alarm.ec2_high_cpu resource
aws_cloudwatch_metric_alarm.ec2_low_cpu resource
aws_sns_topic.cloudwatch_alarms resource
aws_sns_topic_policy.allow_cloudwatch resource
aws_sns_topic_subscription.email resource

Inputs

Inputs

Name Description Type Default Required
environment Environment (e.g., prod, dev, test) string n/a yes
project_name Name of the project string n/a yes
alarm_datapoints_to_alarm Number of datapoints that must be breaching to trigger the alarm number 2 no
alarm_evaluation_periods Number of periods over which data is compared to the threshold number 2 no
alarm_period Period in seconds over which the statistic is applied number 300 no
custom_metrics Custom CloudWatch metrics to create alarms for
map(object({
metric_name = string
namespace = string
threshold = number
statistic = optional(string, "Average")
comparison_operator = optional(string, "GreaterThanThreshold")
evaluation_periods = optional(number, 2)
datapoints_to_alarm = optional(number)
period = optional(number, 300)
description = optional(string, "")
dimensions = optional(map(string), {})
}))
{} no
ec2_high_cpu_threshold CPU utilization threshold for high CPU alarm (percentage) number 80 no
ec2_instance_ids List of EC2 instance IDs to monitor list(string) [] no
ec2_low_cpu_threshold CPU utilization threshold for low CPU alarm (percentage) number 10 no
enable_application_logs Enable application log group creation bool true no
enable_detailed_monitoring Enable detailed monitoring for EC2 instances bool false no
enable_sns_encryption Enable encryption for SNS topic bool true no
log_group_kms_key_id The ARN of the KMS Key to use when encrypting log data string "" no
log_retention_days Number of days to retain logs in CloudWatch number 30 no
name_prefix Prefix for resource names (if not provided, will use project-environment pattern) string "" no
sns_email_endpoints List of email addresses to subscribe to SNS topic list(string) [] no
sns_kms_key_id KMS key ID for SNS topic encryption (if enable_sns_encryption=true) string "alias/aws/sns" no
tags Additional tags for all resources map(string) {} no

Outputs

Outputs

Name Description
alarm_arns Map of CloudWatch alarm names to their ARNs
cpu_alarm_ids The IDs of the CPU alarms created
custom_alarm_ids The IDs of the custom alarms created
log_group_arn The ARN of the CloudWatch Log Group
log_group_name The name of the CloudWatch Log Group
low_cpu_alarm_ids The IDs of the low CPU alarms created
sns_subscription_arns Map of SNS email subscription endpoints to their ARNs
sns_topic_arn The ARN of the SNS topic used for alarms