From e5aa531805e5c5509c1fcafa21e90ccc2d1b1201 Mon Sep 17 00:00:00 2001 From: janli Date: Wed, 23 Oct 2024 19:56:33 -0700 Subject: [PATCH] feat: add new variable ecs_requires_compatibilities --- CHANGELOG.md | 3 ++- VARIABLES.md | 1 + ecs.tf | 4 ++-- variables.tf | 6 ++++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4578a5..5afc37f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,10 +3,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [7.5.2] - 2024-10-23 +## [7.6.0] - 2024-10-24 ### Fixed - Added condition for `k8s` service account secret creation. - Added new variable `ecs_platform_version` to handle ECS platform version update. +- Added new variable `ecs_requires_compatibilities` to support overwriting compatibilities(when with `EC2`, CPU will not able beyond to `8`, and Memorry can not beyond `60G`). ## [7.5.1] - 2024-10-22 ### Added diff --git a/VARIABLES.md b/VARIABLES.md index aab19d1..9c1adca 100644 --- a/VARIABLES.md +++ b/VARIABLES.md @@ -137,6 +137,7 @@ | 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"` +| ecs\_requires\_compatibilities | ECS task definition requires compatibilities. | `list(string)` | `["EC2", "FARGATE"]` | no | ### apiary_assume_roles diff --git a/ecs.tf b/ecs.tf index 46d8935..891d71e 100644 --- a/ecs.tf +++ b/ecs.tf @@ -24,7 +24,7 @@ resource "aws_ecs_task_definition" "apiary_hms_readwrite" { network_mode = "awsvpc" memory = var.hms_rw_heapsize cpu = var.hms_rw_cpu - requires_compatibilities = ["EC2", "FARGATE"] + requires_compatibilities = var.ecs_requires_compatibilities container_definitions = local.hms_readwrite_template tags = var.apiary_tags } @@ -37,7 +37,7 @@ resource "aws_ecs_task_definition" "apiary_hms_readonly" { network_mode = "awsvpc" memory = var.hms_ro_heapsize cpu = var.hms_ro_cpu - requires_compatibilities = ["EC2", "FARGATE"] + requires_compatibilities = var.ecs_requires_compatibilities container_definitions = local.hms_readonly_template tags = var.apiary_tags } diff --git a/variables.tf b/variables.tf index 0907783..0326e0c 100644 --- a/variables.tf +++ b/variables.tf @@ -1005,3 +1005,9 @@ variable "ecs_platform_version" { type = string default = "LATEST" } + +variable "ecs_requires_compatibilities" { + description = "ECS task definition requires compatibilities, default EC2; FARGATE" + type = list(string) + default = ["EC2", "FARGATE"] +}