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

ECS Service Incorrectly Marked as Changed if it has a Placement Strategy #1169

Closed
pnquest opened this issue Jul 17, 2017 · 5 comments
Closed
Labels
bug Addresses a defect in current functionality. service/ecs Issues and PRs that pertain to the ecs service.

Comments

@pnquest
Copy link

pnquest commented Jul 17, 2017

Terraform Version

v0.9.11

Affected Resource(s)

  • aws_ecs_service

Terraform Configuration Files

resource "aws_ecs_service" "service" {
    name = "${var.task_name}${var.environment}"
    cluster = "${var.cluster_id}"
    task_definition = "${module.tsk.task_arn}"
    desired_count = "${var.task_desired_count}"
    iam_role = "${var.task_role_arn}"

    placement_strategy {
        type = "spread"
        field = "host"
    }
}

Expected Behavior

There was no change to the service definition, so terraform plan should have said there were no changes to apply.

Actual Behavior

Terraform thinks the placement_strategy has changed even though it did not. And re-creates the service on every apply. The only workaround I have found for this is removing the placement_strategy

Steps to Reproduce

  1. Create an aws_ecs_service with the placement strategy shown in the above code and apply it.
  2. Immediately run terraform plan again and it will show the service as changed.
  3. You can repeat this infinitely no matter how many times you apply the supposed changes.

References

  • issue 11644 in the main Terraform repo states that the issue (or something very similar) was fixed in version 0.8.6, but this is not the case.
@radeksimko radeksimko added the bug Addresses a defect in current functionality. label Oct 23, 2017
@dcloud9
Copy link

dcloud9 commented Nov 23, 2017

Similar behaviour in aws_ecs_task_definition. No code change, but TF 0.11.0 and aws-provider 1.3.0 always trigger a (forces new resource) on container_definitions and id.

@bflad
Copy link
Contributor

bflad commented Nov 30, 2017

@dcloud9 I think you might be referencing a different bug that was fixed in terraform-provider-aws 1.3.1: #2339

@pnquest this should be fixed in terraform-provider-aws 0.1.3: #1025

@dcloud9
Copy link

dcloud9 commented Nov 30, 2017

Thanks @bflad. Will update to 1.3.1 soon.

@bflad bflad added the service/ecs Issues and PRs that pertain to the ecs service. label Jan 28, 2018
@bflad
Copy link
Contributor

bflad commented Jan 28, 2018

Closing as the mentioned bugs should've been addressed previously (please correct me if I'm wrong): #1169 (comment)

Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@bflad bflad closed this as completed Jan 28, 2018
@ghost
Copy link

ghost commented Apr 8, 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 8, 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. service/ecs Issues and PRs that pertain to the ecs service.
Projects
None yet
Development

No branches or pull requests

4 participants