-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
AWS ECS service is replaced when changing adding a capacity provider #22408
Comments
Observing the same thing. with:
I can successfully switch from aws ecs update-service --cluster dev --service hello-world \
--capacity-provider-strategy=capacityProvider=FARGATE,base=0,weight=100 \
--force-new-deployment but if I try doing this with terraform, I get service recreation warning. We were just about to introduce FARGATE_SPOT in our services, and now we need to push these plans back a bit, because we cannot possible downtime like this on our production environments. |
Looks like the bug is in this line:
The Also, the whole thing requires terraform-provider-aws/internal/service/ecs/service.go Lines 389 to 394 in 41fe8a9
I'm not entirely sure what kind of "backward compatibility" this commend mentions, but if that's something that terraform offered, and now would not, I think that the previous behaviour was a bug, and persisting it like this is not the greatest idea. In general, you don't want your ECS Service to get recreated when changes are applied, because that causes downtime. |
I see this behavior also in one of the latest versions. Is it possible to fix it in the provider?
|
I'm wondering if it's worth adding a new option, something like the below. Pretty much the same as the code block for force_new_deployment but limited to just allowing capacity provider updates without destroying the service if there are no other destructive changes
|
Hi all, I am interested in submiting a fix for this issue as it is impacting our internal usage also. Is the community in agreement what are the latest requirements on how the update should work, as in the comments a couple of ideas are mentioned? |
Community Note
Terraform CLI and Terraform AWS Provider Version
Terraform v0.12.31
Affected Resource(s)
Expected Behavior
The ECS service should have been updated/modified in place.
Actual Behavior
The ECS service was scheduled for replacement, which would cause an outage.
Plan output:
Steps to Reproduce
aws_ecs_service
without a capacity provider specified, launch_type = "FARGATE"aws_ecs_service
to specify acapacity_provider_strategy
as follows:Important Factoids
References
AWS docs: https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_UpdateService.html
The text was updated successfully, but these errors were encountered: