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 support for ECS deployment circuit breakers #16499

Closed
tomelliff opened this issue Dec 1, 2020 · 7 comments · Fixed by #16936
Closed

Add support for ECS deployment circuit breakers #16499

tomelliff opened this issue Dec 1, 2020 · 7 comments · Fixed by #16936
Assignees
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ecs Issues and PRs that pertain to the ecs service.
Milestone

Comments

@tomelliff
Copy link
Contributor

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

AWS has announced ECS deployment circuit breakers that can automatically roll back a failed deployment: https://aws.amazon.com/blogs/containers/announcing-amazon-ecs-deployment-circuit-breaker/

New or Affected Resource(s)

  • aws_ecs_service

Potential Terraform Configuration

resource "aws_ecs_service" "bar" {
  name                = "bar"
  cluster             = aws_ecs_cluster.foo.id
  task_definition     = aws_ecs_task_definition.bar.arn
  scheduling_strategy = "DAEMON"

  deployment_configuration = {
    maximum_percent = 200
    minimum_healthy_percent = 100

    deployment_circuit_breaker = {
      enabled  = true
      rollback = true
    }
  }
}

I'm not a massive fan of that API layout and would love it to be as simple as enable_deployment_circuit_breaker = true as a top level thing but I think the general pattern here is to have Terraform follow the AWS API and then people can abstract that behind modules if that works for them. That way if the API changes it doesn't cause breaking changes in the provider to support the new functionality.

References

@tomelliff tomelliff added the enhancement Requests to existing resources that expand the functionality or scope. label Dec 1, 2020
@ghost ghost added the service/ecs Issues and PRs that pertain to the ecs service. label Dec 1, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Dec 1, 2020
@anGie44 anGie44 removed the needs-triage Waiting for first response or review from a maintainer. label Dec 1, 2020
@mkielar
Copy link
Contributor

mkielar commented Dec 2, 2020

I'm considering using this feature in our automated pipelines, and was wondering how will this be implemented in terraform:

  1. Would terraform wait for the success/failure/rollback of the service deployment?
  2. If rollback is disabled, would terraform apply fail if service deployment fails due to circuit breaker?
  3. If rollback is enabled, would terraform treat a successful rollback as a success or failure? I.e., would a successful rollback fail terraform apply?
  4. If rollback is enabled, would terraform update the state after rollback to reflect infrastructure status?

@zhenglisai
Copy link

when this feature can terraform support?

@shuheiktgw
Copy link
Collaborator

Let me see if I can implement it. It seems the current aws-sdk-go already supports DeploymentCircuitBreaker configuration.

@shuheiktgw
Copy link
Collaborator

I've implemented it so please upvote the PR for a faster review! 🙏
#16936

@anagarjunr
Copy link

waiting for this feature

@YakDriver YakDriver self-assigned this Mar 23, 2021
@github-actions github-actions bot added this to the v3.35.0 milestone Mar 27, 2021
@ghost
Copy link

ghost commented Apr 1, 2021

This has been released in version 3.35.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Apr 26, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Apr 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ecs Issues and PRs that pertain to the ecs service.
Projects
None yet
7 participants