Skip to content

Commit

Permalink
bool variable to enable container insight
Browse files Browse the repository at this point in the history
  • Loading branch information
uolter committed Jan 16, 2024
1 parent 5711ad9 commit 629ba8d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/05-ecs.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Cluster
resource "aws_ecs_cluster" "ecs_cluster" {
name = format("%s-ecs-cluster", local.project)

setting {
name = "containerInsights"
value = var.enable_container_insights ? "enabled" : "diabled"
}

tags = { Name = format("%s-ecs", local.project) }
}

Expand Down
6 changes: 6 additions & 0 deletions src/main/98-variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ variable "ecs_enable_execute_command" {
default = false
}

variable "enable_container_insights" {
type = bool
description = "Enable ecs container insight."
default = false
}

variable "ms_tokenizer_host_name" {
type = string
description = "Toknizer host name. It should be the internal network load balancer."
Expand Down
1 change: 1 addition & 0 deletions src/main/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@
| <a name="input_ecs_autoscaling"></a> [ecs\_autoscaling](#input\_ecs\_autoscaling) | ECS Service autoscaling. | <pre>object({<br> max_capacity = number<br> min_capacity = number<br> scale_in_cooldown = number<br> scale_out_cooldown = number<br> })</pre> | <pre>{<br> "max_capacity": 3,<br> "min_capacity": 1,<br> "scale_in_cooldown": 180,<br> "scale_out_cooldown": 40<br>}</pre> | no |
| <a name="input_ecs_enable_execute_command"></a> [ecs\_enable\_execute\_command](#input\_ecs\_enable\_execute\_command) | Specifies whether to enable Amazon ECS Exec for the tasks within the service. | `bool` | `false` | no |
| <a name="input_ecs_logs_retention_days"></a> [ecs\_logs\_retention\_days](#input\_ecs\_logs\_retention\_days) | Specifies the number of days you want to retain log events in the specified log group. | `number` | `7` | no |
| <a name="input_enable_container_insights"></a> [enable\_container\_insights](#input\_enable\_container\_insights) | Enable ecs container insight. | `bool` | `false` | no |
| <a name="input_enable_nat_gateway"></a> [enable\_nat\_gateway](#input\_enable\_nat\_gateway) | Enable/Create nat gateway | `bool` | `false` | no |
| <a name="input_enable_opsgenie"></a> [enable\_opsgenie](#input\_enable\_opsgenie) | Send alarm via opsgenie. | `bool` | `false` | no |
| <a name="input_enable_sentinel_logs"></a> [enable\_sentinel\_logs](#input\_enable\_sentinel\_logs) | Create all resources required to sento logs to azure sentinel. | `bool` | `false` | no |
Expand Down
1 change: 1 addition & 0 deletions src/main/env/prod/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ vpc_peering = {

# Ecs
ecs_enable_execute_command = true
enable_container_insights = true
replica_count = 3

ecs_autoscaling = {
Expand Down

0 comments on commit 629ba8d

Please sign in to comment.