Skip to content

Auto-heal NAT Instances #96

@osterman

Description

@osterman

We should auto-heal our nat instances. Also, we should probably move NAT to it's own module and support gateways and instances interchangeably so we can re-use across our modules.

# Restart dead bastions and alert
resource "aws_cloudwatch_metric_alarm" "bastion" {
  alarm_name          = "${module.label.id}-status-check-failed"
  comparison_operator = "GreaterThanOrEqualToThreshold"
  evaluation_periods  = "5"
  metric_name         = "StatusCheckFailed_Instance"
  namespace           = "AWS/EC2"
  period              = "60"
  statistic           = "Maximum"
  threshold           = "1"

  dimensions {
    InstanceId = "${aws_instance.nat_instance.id}"
  }

  alarm_actions = [
    "arn:aws:swf:${var.aws_region}:${local.aws_account_id}:action/actions/AWS_EC2.InstanceId.Reboot/1.0",
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestwontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions