-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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 always wants to be recreated due to capacity provider. #22823
Comments
FYI we are still seeing this bug in the provider version 4.9. |
This issue is very destructive. When an ECS cluster has a lifecycle {
ignore_changes = [
capacity_provider_strategy
]
} to be recreated. |
It's the only differences I can see when comparing terraform-provider-aws/internal/service/ecs/service.go Lines 96 to 107 in 611b473
terraform-provider-aws/internal/service/ecs/service.go Lines 44 to 47 in 611b473
|
Hi @nitrocode thanks for looking through the code! My initial thinking was that @spatel96 is using both the terraform-provider-aws/internal/service/ecs/service.go Lines 354 to 372 in a2843eb
capacity_provider_strategy as Computed so that the diff is ignored.
|
I was seeing this same issue and can confirm that adding a |
This has been a big annoyance for us. We have many production ECS Services that are using If we simply set the capacity provider, it will force the re-create of the ECS Service leading to temporary disruption/downtime. This isn't necessary as AWS supports the graceful transition of Our current workaround is to use the (Also, tangentially related is #26533 - for transitioning existing ECS Services to use the Cluster's default capacity provider strategy) |
if I may add, empty
removes strategy from a ECS service (when inherited from default defined at the ECS cluster level) which is useful if you're planning to remove the default capacity provider strategy from the ECS cluster It seems that currently if no |
It's sad to see that It's been over 1 year and still not fixed. :-( AWS has to do a better job than this if they want people to keep using ECS and keep it stay alive. |
any updates on this? I see the PR is pending |
Any update on this? |
@breathingdust Hi, is this something you can look into? The AWS side has been fixed, and now Terraform incorrectly causes replacement. |
Issue still exists. |
Yep we're facing the same problem too |
It's a workaround of a bug hashicorp/terraform-provider-aws#22823 Terraform never converged and wanted to re-create the service. ``` Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: -/+ destroy and then create replacement Terraform will perform the following actions: # module.test.aws_ecs_service.ecs must be replaced -/+ resource "aws_ecs_service" "ecs" { - health_check_grace_period_seconds = 0 -> null ~ iam_role = "/aws-service-role/ecs.amazonaws.com/AWSServiceRoleForECS" -> (known after apply) ~ id = "arn:aws:ecs:us-east-2:303467602807:service/test-terraform-aws-ecs/test-terraform-aws-ecs" -> (known after apply) + launch_type = (known after apply) name = "test-terraform-aws-ecs" + platform_version = (known after apply) - propagate_tags = "NONE" -> null - tags = {} -> null ~ triggers = {} -> (known after apply) # (10 unchanged attributes hidden) - capacity_provider_strategy { # forces replacement - base = 1 -> null - capacity_provider = "test-terraform-aws-ecs" -> null - weight = 100 -> null } - deployment_circuit_breaker { - enable = false -> null - rollback = false -> null } - deployment_controller { - type = "ECS" -> null } # (1 unchanged block hidden) } ```
When the fix would be released? It is affecting my team too. |
+1 This is a major issue. We are running many FARGATE instances and would like to increase the capacity further by adding FARGATE SPOT instances. However, it is not possible to do without downtime (it destroys the whole ECS service and recreates it). |
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
Affected Resource(s)
Terraform Configuration Files
Terraform Plan:
Terraform Apply error:
Expected Behavior
No infrastructure changes should be made
Actual Behavior
The ECS Service resource will be recreated, but the apply with fail with the error logs specified above.
Steps to Reproduce
terraform apply
The text was updated successfully, but these errors were encountered: