From db1fa755801b5bb495fa7a70704cc4ed361282c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Doriann=20Corlou=C3=ABr?= Date: Mon, 17 Jun 2024 22:03:13 +0900 Subject: [PATCH] Enables ASG metrics collection in Cloudwatch (#24) * Allow enabling cloudwatch auto scaling group metrics collection for HA mode * Metrics collection for ASG --------- Co-authored-by: Denis Vazhenin --- README.md | 2 +- asg.tf | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8bea94d..5cbe81f 100644 --- a/README.md +++ b/README.md @@ -112,4 +112,4 @@ module "fck-nat" { | [security\_group\_id](#output\_security\_group\_id) | Deprecated. The ID of the security group used by fck-nat ENIs | | [security\_group\_ids](#output\_security\_group\_ids) | List of security group IDs used by fck-nat ENIs | | [subnet\_id](#output\_subnet\_id) | Subnet ID to which the fck-nat instance is deployed into | -| [vpc\_id](#output\_vpc\_id) | VPC ID to which the fck-nat instance is deployed into | \ No newline at end of file +| [vpc\_id](#output\_vpc\_id) | VPC ID to which the fck-nat instance is deployed into | diff --git a/asg.tf b/asg.tf index ba0724a..641dea1 100644 --- a/asg.tf +++ b/asg.tf @@ -29,6 +29,29 @@ resource "aws_autoscaling_group" "main" { } } + enabled_metrics = [ + "GroupMinSize", + "GroupMaxSize", + "GroupDesiredCapacity", + "GroupInServiceInstances", + "GroupPendingInstances", + "GroupStandbyInstances", + "GroupTerminatingInstances", + "GroupTotalInstances", + "GroupInServiceCapacity", + "GroupPendingCapacity", + "GroupStandbyCapacity", + "GroupTerminatingCapacity", + "GroupTotalCapacity", + "WarmPoolDesiredCapacity", + "WarmPoolWarmedCapacity", + "WarmPoolPendingCapacity", + "WarmPoolTerminatingCapacity", + "WarmPoolTotalCapacity", + "GroupAndWarmPoolDesiredCapacity", + "GroupAndWarmPoolTotalCapacity" + ] + timeouts { delete = "15m" }