From 7a45523d1d4907fc98c17c85f7051e314b2b734e Mon Sep 17 00:00:00 2001 From: janli Date: Wed, 23 Oct 2024 18:53:42 -0700 Subject: [PATCH] feat: add ecs platform version --- CHANGELOG.md | 1 + VARIABLES.md | 1 + ecs.tf | 15 ++++++++------- variables.tf | 6 ++++++ 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f83d0e..c4578a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [7.5.2] - 2024-10-23 ### Fixed - Added condition for `k8s` service account secret creation. +- Added new variable `ecs_platform_version` to handle ECS platform version update. ## [7.5.1] - 2024-10-22 ### Added diff --git a/VARIABLES.md b/VARIABLES.md index 8400a68..aab19d1 100644 --- a/VARIABLES.md +++ b/VARIABLES.md @@ -136,6 +136,7 @@ | tcp\_keepalive\_time | Sets net.ipv4.tcp_keepalive_time (seconds). | number | `200` | no | | tcp\_keepalive\_intvl | Sets net.ipv4.tcp_keepalive_intvl (seconds) | number | `30` | no | | tcp\_keepalive\_probes | Sets net.ipv4.tcp_keepalive_probes (seconds) | number | `2` | no | +| ecs\_platform\_version | ECS Service Platform Version | `string` | `"LATEST"` ### apiary_assume_roles diff --git a/ecs.tf b/ecs.tf index 694ef7f..46d8935 100644 --- a/ecs.tf +++ b/ecs.tf @@ -70,13 +70,14 @@ resource "aws_ecs_service" "apiary_hms_readwrite_service" { } resource "aws_ecs_service" "apiary_hms_readonly_service" { - count = var.hms_instance_type == "ecs" ? 1 : 0 - depends_on = [aws_lb_target_group.apiary_hms_ro_tg] - name = "${local.instance_alias}-hms-readonly-service" - launch_type = "FARGATE" - cluster = aws_ecs_cluster.apiary[0].id - task_definition = aws_ecs_task_definition.apiary_hms_readonly[0].arn - desired_count = var.hms_ro_ecs_task_count + count = var.hms_instance_type == "ecs" ? 1 : 0 + depends_on = [aws_lb_target_group.apiary_hms_ro_tg] + name = "${local.instance_alias}-hms-readonly-service" + launch_type = "FARGATE" + platform_version = var.ecs_platform_version + cluster = aws_ecs_cluster.apiary[0].id + task_definition = aws_ecs_task_definition.apiary_hms_readonly[0].arn + desired_count = var.hms_ro_ecs_task_count load_balancer { target_group_arn = aws_lb_target_group.apiary_hms_ro_tg[0].arn diff --git a/variables.tf b/variables.tf index 8775b3d..0907783 100644 --- a/variables.tf +++ b/variables.tf @@ -999,3 +999,9 @@ variable "apiary_managed_service_iamroles" { type = list(string) default = [] } + +variable "ecs_platform_version" { + description = "ECS Service Platform Version" + type = string + default = "LATEST" +}