diff --git a/README.md b/README.md index 6f79c83..01f241b 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ EOF | autoscaling\_cpu\_low\_threshold | Autoscaling CPU threshold for scale-down | string | `40` | no | | availability\_zones | List of availability zones which will be provisined by autoscailing group | list | `[]` | yes | | vpc\_id | The ID of VPC | string | - | yes | +| container\_insights\_monitoring | Defines enable/disable Cloudwatch Container Insights monitoring | string | `disabled` | no | ### Container definitions default value diff --git a/ecs-cluster.tf b/ecs-cluster.tf index b07364e..03d7e4b 100644 --- a/ecs-cluster.tf +++ b/ecs-cluster.tf @@ -1,6 +1,11 @@ resource "aws_ecs_cluster" "this" { count = var.use_existant_cluster ? 0 : 1 name = "${var.project}-${var.environment}" + + setting { + name = "containerInsights" + value = var.container_insights_monitoring + } tags = merge(local.default_tags, var.tags) } diff --git a/variables.tf b/variables.tf index e8c9b67..faf74c4 100644 --- a/variables.tf +++ b/variables.tf @@ -159,3 +159,7 @@ variable "autoscaling_cpu_low_threshold" { default = "40" } +variable "container_insights_monitoring" { + description = "Defines enable/disable Cloudwatch Container Insights monitoring" + default = "disabled" +}