From 5048e2440b2cf95413a167b0da693b8e078dbd03 Mon Sep 17 00:00:00 2001 From: "angle.wang" Date: Thu, 30 May 2024 17:21:13 +0800 Subject: [PATCH] feat: add launch type --- README.md | 1 + main.tf | 1 + variables.tf | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/README.md b/README.md index a9485c5..8330b83 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,7 @@ No modules. | [https\_listener\_rules](#input\_https\_listener\_rules) | A list of maps describing the Listener Rules for this ALB. Required key/values: actions, conditions. Optional key/values: priority, https\_listener\_index (default to https\_listeners[count.index]) | `any` | `[]` | no | | [is\_default\_tg](#input\_is\_default\_tg) | n/a | `bool` | `false` | no | | [is\_log](#input\_is\_log) | container auto aws driver with log | `bool` | `true` | no | +| [launch\_type](#input\_launch\_type) | n/a | `string` | `"EC2"` | no | | [lb\_stickiness](#input\_lb\_stickiness) | n/a | `any` | `null` | no | | [listener\_arn](#input\_listener\_arn) | n/a | `string` | `""` | no | | [load\_balancing\_algorithm\_type](#input\_load\_balancing\_algorithm\_type) | alb algorithm | `string` | `"round_robin"` | no | diff --git a/main.tf b/main.tf index b1c8071..7d61ab8 100644 --- a/main.tf +++ b/main.tf @@ -323,6 +323,7 @@ resource "aws_ecs_service" "this" { # task_definition = "${aws_ecs_task_definition.this.family}:${max("${aws_ecs_task_definition.this.revision}", "${data.aws_ecs_task_definition.this.revision}")}" task_definition = "${aws_ecs_task_definition.this.family}:${max("${aws_ecs_task_definition.this.revision}", "${data.aws_ecs_task_definition.this.revision}")}" desired_count = local.desired_count + launch_type = var.launch_type force_new_deployment = true deployment_maximum_percent = var.deployment_maximum_percent deployment_minimum_healthy_percent = var.deployment_minimum_healthy_percent diff --git a/variables.tf b/variables.tf index 713f83d..ef2eb14 100644 --- a/variables.tf +++ b/variables.tf @@ -169,3 +169,8 @@ variable "lb_stickiness" { * } */ } + +variable "launch_type" { + type = string + default = "EC2" +}