Skip to content

Commit 526a183

Browse files
committed
fix: Change default deployment percentages when using EFA to allow updates to succeed
1 parent 8126422 commit 526a183

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.83.6
3+
rev: v1.88.0
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_validate

main.tf

+6-2
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,10 @@ locals {
188188
sourceVolume = "efs"
189189
readOnly = false
190190
}] : try(var.atlantis.mount_points, [])
191+
192+
# Ref https://github.com/terraform-aws-modules/terraform-aws-atlantis/issues/383
193+
deployment_maximum_percent = var.enable_efs ? 100 : 200
194+
deployment_minimum_healthy_percent = var.enable_efs ? 0 : 66
191195
}
192196

193197
module "ecs_cluster" {
@@ -229,8 +233,8 @@ module "ecs_service" {
229233
capacity_provider_strategy = try(var.service.capacity_provider_strategy, {})
230234
cluster_arn = var.create_cluster && var.create ? module.ecs_cluster.arn : var.cluster_arn
231235
deployment_controller = try(var.service.deployment_controller, {})
232-
deployment_maximum_percent = try(var.service.deployment_maximum_percent, 200)
233-
deployment_minimum_healthy_percent = try(var.service.deployment_minimum_healthy_percent, 66)
236+
deployment_maximum_percent = try(var.service.deployment_maximum_percent, local.deployment_maximum_percent)
237+
deployment_minimum_healthy_percent = try(var.service.deployment_minimum_healthy_percent, local.deployment_minimum_healthy_percent)
234238
desired_count = try(var.service.desired_count, 1)
235239
enable_ecs_managed_tags = try(var.service.enable_ecs_managed_tags, true)
236240
enable_execute_command = try(var.service.enable_execute_command, false)

0 commit comments

Comments
 (0)