Open petr-motejlek opened 2 years ago
I'm having the same issue and just checked the api docs. They do not specifically state that you would not be allowed to set a circuit breaker configuration and a minimum/maxumim healthyness count. Ref: https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateService.html
I'm seeing this issue through the usage of the cloudposse ecs-service-task module. However i can see in the terraform aws provider code, that this behaviour would always happen when a circuit breaker configuration is set in any way. That is because the deployment configuration is re-set to an empy state instead of being expanded. Ref: https://github.com/hashicorp/terraform-provider-aws/blob/bfcd55c7cde9b2190aa0a18e6110c967e1ad5458/internal/service/ecs/service.go#L481
EDIT: Funnily after re-doing my terraform apply when the ecs-service existed already, suddenly it wants to fix it. So creation vs. updating seem to behave differently here.
Community Note
Terraform CLI and Terraform AWS Provider Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://gist.github.com/petr-motejlek/2752b9681c1c8cb2514b14f7695c29e0
deployment_circuit_breaker
block presentPanic Output
N/A
Expected Behavior
When the
deployment_circuit_breaker
block is present, thedeployment_minimum_healthy_percent
anddeployment_maximum_percent
options should be sent to the CreateService API.Actual Behavior
When the
deployment_circuit_breaker
block is present (even completely disabled), the CreateService API is called without the minimum and maximum percentages.Steps to Reproduce
(With the
deployment_circuit_breaker
block)terraform plan
-- this will display a plan with the desired minimum and maximum percentagesterraform apply
-- this will create all the resources; the CreateService call will be made without the minimum and maximum percentages (despite the plan)terraform apply
-- this will detect a change (the minimum and maximum percentages not being set properly) and will rectifyImportant Factoids
I suspect, not having looked at the code, that whatever component generates the CreateService call, does not include the minimum and maximum percentages, by completely overwriting the DeploymentConfiguration field of the API call. I guess instead of an append to the collection, it replaces it.
References
N/A