-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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 'Host' Placement Strategy Forcing Service Rebuild #938
Comments
stack72
added a commit
that referenced
this issue
Jun 30, 2017
Fixes: #938 When aws_ecs_service has a placement_strategy of type `spread`, you can use a field of `instanceId` or `host` interchangable. BUT AWS will normalize the field value to return `instanceId`. We have introduced a custom Set func to manage this work so that we understand when someone uses `host`, we won't get a diff when AWS return `instanceId` -> if there is a diff, a ForceNew is applied ``` % make testacc TEST=./aws TESTARGS='-run=TestAccAWSEcsService' ✹ ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -run=TestAccAWSEcsService -timeout 120m === RUN TestAccAWSEcsServiceWithARN --- PASS: TestAccAWSEcsServiceWithARN (147.06s) === RUN TestAccAWSEcsServiceWithUnnormalizedPlacementStrategy --- PASS: TestAccAWSEcsServiceWithUnnormalizedPlacementStrategy (116.97s) === RUN TestAccAWSEcsServiceWithFamilyAndRevision --- PASS: TestAccAWSEcsServiceWithFamilyAndRevision (125.69s) === RUN TestAccAWSEcsServiceWithRenamedCluster --- PASS: TestAccAWSEcsServiceWithRenamedCluster (268.02s) === RUN TestAccAWSEcsService_withIamRole --- PASS: TestAccAWSEcsService_withIamRole (155.57s) === RUN TestAccAWSEcsService_withDeploymentValues --- PASS: TestAccAWSEcsService_withDeploymentValues (128.80s) === RUN TestAccAWSEcsService_withLbChanges --- PASS: TestAccAWSEcsService_withLbChanges (242.82s) === RUN TestAccAWSEcsService_withEcsClusterName --- PASS: TestAccAWSEcsService_withEcsClusterName (113.21s) === RUN TestAccAWSEcsService_withAlb --- PASS: TestAccAWSEcsService_withAlb (349.69s) === RUN TestAccAWSEcsServiceWithPlacementStrategy --- PASS: TestAccAWSEcsServiceWithPlacementStrategy (238.08s) === RUN TestAccAWSEcsServiceWithPlacementConstraints --- PASS: TestAccAWSEcsServiceWithPlacementConstraints (123.41s) === RUN TestAccAWSEcsServiceWithPlacementConstraints_emptyExpression --- PASS: TestAccAWSEcsServiceWithPlacementConstraints_emptyExpression (126.25s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 2138.968s ```
stack72
added a commit
that referenced
this issue
Jun 30, 2017
#1025) Fixes: #938 When aws_ecs_service has a placement_strategy of type `spread`, you can use a field of `instanceId` or `host` interchangable. BUT AWS will normalize the field value to return `instanceId`. We have introduced a custom Set func to manage this work so that we understand when someone uses `host`, we won't get a diff when AWS return `instanceId` -> if there is a diff, a ForceNew is applied ``` % make testacc TEST=./aws TESTARGS='-run=TestAccAWSEcsService' ✹ ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -run=TestAccAWSEcsService -timeout 120m === RUN TestAccAWSEcsServiceWithARN --- PASS: TestAccAWSEcsServiceWithARN (147.06s) === RUN TestAccAWSEcsServiceWithUnnormalizedPlacementStrategy --- PASS: TestAccAWSEcsServiceWithUnnormalizedPlacementStrategy (116.97s) === RUN TestAccAWSEcsServiceWithFamilyAndRevision --- PASS: TestAccAWSEcsServiceWithFamilyAndRevision (125.69s) === RUN TestAccAWSEcsServiceWithRenamedCluster --- PASS: TestAccAWSEcsServiceWithRenamedCluster (268.02s) === RUN TestAccAWSEcsService_withIamRole --- PASS: TestAccAWSEcsService_withIamRole (155.57s) === RUN TestAccAWSEcsService_withDeploymentValues --- PASS: TestAccAWSEcsService_withDeploymentValues (128.80s) === RUN TestAccAWSEcsService_withLbChanges --- PASS: TestAccAWSEcsService_withLbChanges (242.82s) === RUN TestAccAWSEcsService_withEcsClusterName --- PASS: TestAccAWSEcsService_withEcsClusterName (113.21s) === RUN TestAccAWSEcsService_withAlb --- PASS: TestAccAWSEcsService_withAlb (349.69s) === RUN TestAccAWSEcsServiceWithPlacementStrategy --- PASS: TestAccAWSEcsServiceWithPlacementStrategy (238.08s) === RUN TestAccAWSEcsServiceWithPlacementConstraints --- PASS: TestAccAWSEcsServiceWithPlacementConstraints (123.41s) === RUN TestAccAWSEcsServiceWithPlacementConstraints_emptyExpression --- PASS: TestAccAWSEcsServiceWithPlacementConstraints_emptyExpression (126.25s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 2138.968s ```
Thanks! 👍 |
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
locked and limited conversation to collaborators
Apr 11, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Small thing: if you use the field
host
in a placement strategy of typespread
within an ECS Service definition a service rebuild will occur on every apply. This looks to be a similar issue to #13216 over in the main repo, except instead of case differences it's an interchangeable term.host
andinstanceId
are interchangeable and mean the same thing (docs) but it seems the AWS CLI will always return instanceId irrespective of which is originally specified when creating the resource, which I'm picking is the cause of the issue.Terraform Version
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Debug Output
Sorry not a debug but the plan output shows enough detail to spot the issue I think:
Expected Behavior
No change to the service resource, since there is no change to the placement strategy
Actual Behavior
The service resource will be destroyed and recreated on every
terraform apply
.Steps to Reproduce
spread
with fieldhost
terraform apply
to createterraform apply
without changing any tf config will force a new resourceImportant Factoids
Perfectly acceptable workaround is to just use
instanceId
, but I figured it was worth reporting this anywayReferences
Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:
The text was updated successfully, but these errors were encountered: