Skip to content

Commit ef91934

Browse files
committed
feat: add support for deployment_circuit_breaker configuration
This change adds support for the ECS deployment circuit breaker feature, which allows for automatic rollback of failed deployments. The deployment_circuit_breaker configuration is now passed through from the service variable to the underlying ECS service module, enabling users to configure automatic rollback behavior for their Atlantis deployments. Example usage: service = { deployment_circuit_breaker = { enable = true rollback = true } } Updated both example configurations (github-complete and github-separate) to demonstrate the circuit breaker feature. Tested locally by referencing the module and confirming the circuit breaker configuration is properly applied to the ECS service.
1 parent aee16dd commit ef91934

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,26 @@ module "atlantis" {
200200
}
201201
```
202202

203+
### Enable Deployment Circuit Breaker
204+
205+
You can enable the ECS deployment circuit breaker to automatically roll back failed deployments:
206+
207+
```hcl
208+
module "atlantis" {
209+
source = "terraform-aws-modules/atlantis/aws"
210+
211+
# ...
212+
213+
service = {
214+
# Enable circuit breaker for automatic rollback on failed deployments
215+
deployment_circuit_breaker = {
216+
enable = true
217+
rollback = true
218+
}
219+
}
220+
}
221+
```
222+
203223
## Examples
204224

205225
- [Complete Atlantis with GitHub webhook](https://github.com/terraform-aws-modules/terraform-aws-atlantis/tree/master/examples/github-complete)

examples/github-complete/main.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ module "atlantis" {
7070
tasks_iam_role_policies = {
7171
AdministratorAccess = "arn:aws:iam::aws:policy/AdministratorAccess"
7272
}
73+
74+
# Enable circuit breaker for automatic rollback on failed deployments
75+
deployment_circuit_breaker = {
76+
enable = true
77+
rollback = true
78+
}
7379
}
7480

7581
# ALB

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ module "ecs_service" {
235235
alarms = try(var.service.alarms, {})
236236
capacity_provider_strategy = try(var.service.capacity_provider_strategy, {})
237237
cluster_arn = var.create_cluster && var.create ? module.ecs_cluster.arn : var.cluster_arn
238+
deployment_circuit_breaker = try(var.service.deployment_circuit_breaker, {})
238239
deployment_controller = try(var.service.deployment_controller, {})
239240
deployment_maximum_percent = try(var.service.deployment_maximum_percent, local.deployment_maximum_percent)
240241
deployment_minimum_healthy_percent = try(var.service.deployment_minimum_healthy_percent, local.deployment_minimum_healthy_percent)

0 commit comments

Comments
 (0)