Skip to content

Commit

Permalink
added ability to enable/disable cw container insights (#18)
Browse files Browse the repository at this point in the history
Co-authored-by: rshved <[email protected]>
  • Loading branch information
hutemai and rshved authored Jul 19, 2021
1 parent a501645 commit ce0d747
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions ecs-cluster.tf
Original file line number Diff line number Diff line change
@@ -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)
}

Expand Down
4 changes: 4 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

0 comments on commit ce0d747

Please sign in to comment.