From 834bc0da151eabaa459ebe838fc1ca6e4184d11e Mon Sep 17 00:00:00 2001 From: Bryant Biggs Date: Mon, 4 Mar 2024 16:54:55 -0500 Subject: [PATCH] fix: Change default deployment percentages when using EFS to allow updates to succeed (#399) fix: Change default deployment percentages when using EFA to allow updates to succeed --- .pre-commit-config.yaml | 2 +- main.tf | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 93900a8e..0c542c84 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/antonbabenko/pre-commit-terraform - rev: v1.86.0 + rev: v1.88.0 hooks: - id: terraform_fmt - id: terraform_validate diff --git a/main.tf b/main.tf index b37289c3..735f38f5 100644 --- a/main.tf +++ b/main.tf @@ -188,6 +188,10 @@ locals { sourceVolume = "efs" readOnly = false }] : try(var.atlantis.mount_points, []) + + # Ref https://github.com/terraform-aws-modules/terraform-aws-atlantis/issues/383 + deployment_maximum_percent = var.enable_efs ? 100 : 200 + deployment_minimum_healthy_percent = var.enable_efs ? 0 : 66 } module "ecs_cluster" { @@ -229,8 +233,8 @@ module "ecs_service" { capacity_provider_strategy = try(var.service.capacity_provider_strategy, {}) cluster_arn = var.create_cluster && var.create ? module.ecs_cluster.arn : var.cluster_arn deployment_controller = try(var.service.deployment_controller, {}) - deployment_maximum_percent = try(var.service.deployment_maximum_percent, 200) - deployment_minimum_healthy_percent = try(var.service.deployment_minimum_healthy_percent, 66) + deployment_maximum_percent = try(var.service.deployment_maximum_percent, local.deployment_maximum_percent) + deployment_minimum_healthy_percent = try(var.service.deployment_minimum_healthy_percent, local.deployment_minimum_healthy_percent) desired_count = try(var.service.desired_count, 1) enable_ecs_managed_tags = try(var.service.enable_ecs_managed_tags, true) enable_execute_command = try(var.service.enable_execute_command, false)