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

[regression in 1.42] aws_ecs_service min/max deployment percent error #6315

Closed
fabienrenaud opened this issue Nov 1, 2018 · 9 comments · Fixed by #6316
Closed

[regression in 1.42] aws_ecs_service min/max deployment percent error #6315

fabienrenaud opened this issue Nov 1, 2018 · 9 comments · Fixed by #6316
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/ecs Issues and PRs that pertain to the ecs service.
Milestone

Comments

@fabienrenaud
Copy link

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 "me too" comments, 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

Terraform Version

Latest hashicorp/terraform:light:
Terraform v0.11.10

Affected Resource(s)

  • aws_ecs_service

Actual vs expected Behavior

resource "aws_ecs_service" "my_service" {
  name = "..."
  cluster = "..."
  task_definition = "${aws_ecs_task_definition.my_service.arn}"
  desired_count = "${var.desired_count}"
  deployment_minimum_healthy_percent = "0"
  deployment_maximum_percent = "100"

  placement_constraints {
    type = "distinctInstance"
  }
}

Triggered the following error with aws provider 1.42:

* aws_ecs_service.simulation: InvalidParameterException: Both maximumPercent and minimumHealthyPercent cannot be 100 as this will block deployments.
	status code: 400, ...

The same terraform configs were working with 1.41 and downgrading to 1.41 cleared the error.

Steps to Reproduce

  1. Create ECS resource with deployment_minimum_healthy_percent = "0" and deployment_maximum_percent = "100".
  2. Plan and apply with aws provider 1.42 and notice the error and thus failure in creating the ECS cluster.
  3. Downgrade to aws provider 1.41 and notice apply runs smoothly.
@bflad bflad added bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/ecs Issues and PRs that pertain to the ecs service. labels Nov 1, 2018
@bflad
Copy link
Contributor

bflad commented Nov 1, 2018

Hi @fabienrenaud 👋Thanks for reporting this and sorry for the trouble! The change that created this issue is #6150. Its unfortunate that the acceptance testing did not pick this up, but we will fix that for the future.

If I had to venture a quick guess, I think the issue is that d.GetOk() will omit "zero" values (e.g. 0 for schema.TypeInt) so the API is likely receiving the replica strategy minimum default of 100 instead of your intended configuration of 0. We can see if changing it to d.GetOkExists() will fix the issue, but it may require additional handling as well.

You can potentially work around this on version 1.42.0 with deployment_minimum_healthy_percent = 1 (or if my theory is right, any positive, non-0 value).

I'll mark this regression as a blocker for the next release, which will be 1.43.0 or 1.42.1.

@bflad
Copy link
Contributor

bflad commented Nov 1, 2018

Bug fix pull request submitted with covering acceptance test: #6316

@bflad
Copy link
Contributor

bflad commented Nov 2, 2018

Sorry again for the issue here! The fix with a covering acceptance test has been merged and will release with version 1.43.0 of the AWS provider, likely middle of next week. 👍

@contactcuong
Copy link

Sorry if spamming but I got the same exactly issue, downgrade to aws provider 1.41.0 and it worked fine.

@bflad
Copy link
Contributor

bflad commented Nov 7, 2018

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

@aaronjhoffman
Copy link

@bflad - I tried changing the deployment_minimum_healthy_percent = 1 but that seems to have caused other issues. I looked at the provider versioning but not sure how to modify it. Can you help?

@bflad
Copy link
Contributor

bflad commented Nov 8, 2018

@aaronjhoffman how can I help? We generally recommend adding the version configuration within your provider "aws" configuration blocks then running terraform init to upgrade your provider. e.g.

provider "aws" {
  # ... potentially other configuration ...
  version = "1.43.0"
}

If you would rather just remain on latest (e.g. you don't have provider "aws" configurations, have provider "aws" configuration blocks with version "~> 1.#", or would prefer to leave all provider "aws" configuration blocks without a version defined), then theoretically running terraform init -upgrade will update it.

If there are ways we can improve that documentation, please let us know.

@aaronjhoffman
Copy link

Thank you @bflad ! I found the configuration and noticed there is no version defined for the provider. I ran the terraform init -upgrade and seems to have done the trick!

@ghost
Copy link

ghost commented Apr 2, 2020

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 and limited conversation to collaborators Apr 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/ecs Issues and PRs that pertain to the ecs service.
Projects
None yet
4 participants