Open lockwobr opened 2 years ago
This is an interesting one as I understood that placement constraints were not supported by Fargate at all.
See https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement.html where it says "Task placement strategies and constraints aren't supported for tasks using the Fargate launch type. Fargate tasks are spread across Availability Zones"
So to me the bug is that the provider allowed you to create a placement constraint at all when it's not supported.
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.
If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!
Summary
I was trying to add to existing ECS services a placement constraint. I applied this with no issues. I later tried to create a new service with this same placement constraint and got the below error. This issue corrupted my state file. I could not revert the existing ECS services, nor could I destroy them. To fix my state file I had to remove all ECS services from the state file, then manually delete the services outside of terraform and then recreate them to fix the state file.
Because I had these issues it then tried to add the same constraint on the task definition and got another error. I was lucky this time it was on create, so it didn't mess up the state file.
Community Note
Terraform CLI and Terraform AWS Provider Version
Affected Resource(s)
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
Debug Output
Actual Behavior
ECS Service error.
ECS Task Definition error.
Steps to Reproduce
ECS Service Issue.
ECS Task Definition issue.
Important Factoids