New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add deployment circuit breaker configuration #44
Conversation
modules/service/variables.tf
Outdated
variable "deployment_circuit_breaker" { | ||
type = bool | ||
default = true | ||
} | ||
|
||
variable "deployment_circuit_breaker_rollback" { | ||
type = bool | ||
default = false | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you provide some descriptions of what these variables do? Or possibly give them names to reflect the outcome they achieve?
e.g.
variable "stop_deployment_if_tasks_fail_to_start"
variable "rollback_deployment_if_tasks_fail_to_start"
or maybe this wants to be a three-way toggle:
variable "deployment_behaviour_if_tasks_fail_to_start"
with three options:
- "do nothing"
- "stop deployment"
- "roll back deployment"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree comments are handy, have added some descriptions and comments linking out to AWS blog on the topic.
…collection/terraform-aws-ecs-service into adds-deployment-circuit-breaker
modules/service/service.tf
Outdated
dynamic "deployment_circuit_breaker" { | ||
for_each = var.deployment_circuit_breaker ? ["single"] : [] | ||
|
||
content { | ||
enable = true | ||
rollback = var.deployment_circuit_breaker_rollback | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a dynamic block? Could we pass the value of var.deployment_circuit_breaker
into enable
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it might prevent us getting into a strange situation with deployment_circuit_breaker_rollback
being true and deployment_circuit_breaker
being false, but apparently the ECS API doesn't care if you set rollback to true and do not have the circuit breaker enabled, so lets chuck the dynamic block 👍
…collection/terraform-aws-ecs-service into adds-deployment-circuit-breaker
This change adds deployment circuit breaker configuration to our ECS module and enables it by default.
This change also fixes the example ECS deployment by referring to the correct shared state.