Usage

Creates two metric alarms for use with an ALB

  • ALB 5XX Metric Alarm (Relating only to the ALB)
  • ALB Target 5XX Metric Alarm (Relating only to the Target(s) behind the ALB)
module "alb_metric_alarms" {
  source = "dod-iac/alb-mteric-alarms/aws"

  name           = var.application
  environment    = var.environment
  alb_arn_suffix = module.alb_web_containers.alb_arn_suffix

  actions_alarm             = [var.sns_topic_arn]
  actions_ok                = [var.sns_topic_arn]
  actions_insufficient_data = [var.sns_topic_arn]

  alb_5xx_threshold        = "5"
  alb_target_5xx_threshold = "15"

  tags = {
    Application = var.application
    Environment = var.environment
    Automation  = "Terraform"
  }
}

Terraform Version

Terraform 0.13. Pin module version to ~> 1.0.0 . Submit pull-requests to master branch.

Terraform 0.11 and 0.12 are not supported.

License

This project constitutes a work of the United States Government and is not subject to domestic copyright protection under 17 USC § 105. However, because the project utilizes code licensed from contributors and other third parties, it therefore is licensed under the MIT License. See LICENSE file for more information.

Requirements

Name Version
terraform >= 0.13
aws ~> 3.0

Providers

Name Version
aws ~> 3.0

Modules

No Modules.

Resources

Name
aws_cloudwatch_metric_alarm

Inputs

Name Description Type Default Required
actions_alarm List of alarm actions to take list(string) [] no
actions_enabled Enable the actions. Set to false to temporarily disable actions. bool true no
actions_insufficient_data List of insufficient data actions to take list(string) [] no
actions_ok List of ok actions to take list(string) [] no
alb_5xx_threshold The 5XX threshold for the ALB metric alarm string "10" no
alb_arn_suffix The ARN Suffix of the ALB for use with CloudWatch Metrics. string n/a yes
alb_target_5xx_threshold The 5XX threshold for the ALB target metric alarm string "10" no
enable_alb_metric_alarm Enable the ALB metric alarm bool true no
enable_alb_target_metric_alarm Enable the ALB target metric alarm bool true no
environment Environment tag, e.g prod. string n/a yes
name The service name. string n/a yes
tags Tags applied to the metric alarms. map(string) {} no

Outputs

Name Description
alb_5xx_metric_alarm_arn The ARN of the ALB 5XX metric alarm
alb_5xx_metric_alarm_id The ID of the ALB 5XX metric alarm
alb_target_5xx_metric_alarm_arn The ARN of the ALB Target 5XX metric alarm
alb_target_5xx_metric_alarm_id The ID of the ALB Target 5XX metric alarm