# CloudWatch alarm An alarm that notifies an SNS topic. ```hcl resource "aws_sns_topic" "on_call" { name = "on-call" kms_master_key_id = "alias/aws/sns" } resource "aws_cloudwatch_metric_alarm" "errors" { alarm_name = "ingest-errors" namespace = "AWS/Lambda" metric_name = "Errors" statistic = "Sum" period = 300 evaluation_periods = 1 threshold = 1 comparison_operator = "GreaterThanOrEqualToThreshold" treat_missing_data = "notBreaching" alarm_actions = [aws_sns_topic.on_call.arn] dimensions = { FunctionName = "ingest" } } ```