Skip to content
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

Merged
merged 8 commits into from Sep 17, 2021

Conversation

kenoir
Copy link
Contributor

@kenoir kenoir commented Sep 17, 2021

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.

@kenoir kenoir requested a review from a team September 17, 2021 12:49
Comment on lines 31 to 40
variable "deployment_circuit_breaker" {
type = bool
default = true
}

variable "deployment_circuit_breaker_rollback" {
type = bool
default = false
}

Copy link
Contributor

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"

Copy link
Contributor Author

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.

alexwlchan
alexwlchan previously approved these changes Sep 17, 2021
Comment on lines 24 to 32
dynamic "deployment_circuit_breaker" {
for_each = var.deployment_circuit_breaker ? ["single"] : []

content {
enable = true
rollback = var.deployment_circuit_breaker_rollback
}
}

Copy link
Contributor

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?

Copy link
Contributor Author

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 👍

@kenoir kenoir merged commit deb99b0 into main Sep 17, 2021
@kenoir kenoir deleted the adds-deployment-circuit-breaker branch September 17, 2021 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants