From 58f0e2af75657527efbee4b2754f518217bfb261 Mon Sep 17 00:00:00 2001 From: Ethan Edwards Date: Mon, 26 Nov 2018 22:01:36 -0600 Subject: [PATCH] configures enabled_metrics for asg using var.enabled_metrics --- modules/vault-cluster/main.tf | 2 ++ modules/vault-cluster/variables.tf | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/modules/vault-cluster/main.tf b/modules/vault-cluster/main.tf index d6cab0ee..13c85053 100644 --- a/modules/vault-cluster/main.tf +++ b/modules/vault-cluster/main.tf @@ -28,6 +28,8 @@ resource "aws_autoscaling_group" "autoscaling_group" { health_check_grace_period = "${var.health_check_grace_period}" wait_for_capacity_timeout = "${var.wait_for_capacity_timeout}" + enabled_metrics = ["${var.enabled_metrics}"] + # Use bucket and policies names in tags for depending on them when they are there # And only create the cluster after S3 bucket and policies exist # Otherwise Vault might boot and not find the bucket or not yet have the necessary permissions diff --git a/modules/vault-cluster/variables.tf b/modules/vault-cluster/variables.tf index eab9b76b..c0b49576 100644 --- a/modules/vault-cluster/variables.tf +++ b/modules/vault-cluster/variables.tf @@ -207,3 +207,9 @@ variable "force_destroy_s3_bucket" { description = "If 'configure_s3_backend' is enabled and you set this to true, when you run terraform destroy, this tells Terraform to delete all the objects in the S3 bucket used for backend storage. You should NOT set this to true in production or you risk losing all your data! This property is only here so automated tests of this module can clean up after themselves. Only used if 'enable_s3_backend' is set to true." default = false } + +variable "enabled_metrics" { + description = "List of autoscaling group metrics to enable." + type = "list" + default = [] +}