terraform-provider-aws icon indicating copy to clipboard operation
terraform-provider-aws copied to clipboard

aws_ecs_service inconsistent delete timeout handling

Open nijave opened this issue 4 years ago • 3 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

New or Affected Resource(s)

  • aws_ecs_service
aws_ecs_service.main: Still destroying... [id=arn:aws:ecs:us-east-1:abc123:serv...ng/my-service, 10m0s elapsed]                                                                                                                                                                                                                                     

Error: timeout while waiting for state to become 'INACTIVE' (last state: 'DRAINING', timeout: 10m0s)

The currrent implementation tries to delete for a given timeout but then waits for a fixed amount of time. This leads to failures for services that have high load balancer drain delays set https://github.com/hashicorp/terraform-provider-aws/blob/main/aws/resource_aws_ecs_service.go#L1119 https://github.com/hashicorp/terraform-provider-aws/blob/main/aws/resource_aws_ecs_service.go#L1141

nijave avatar Feb 10 '21 15:02 nijave

wonding if there a workaround for this or if this will get some attention.

bostrowski13 avatar Sep 22 '22 17:09 bostrowski13

Put this parameter <force_delete = true> in the resource aws_autoscaling_group. It's worked for me.

ZdeAttre avatar Feb 17 '23 13:02 ZdeAttre

Put this parameter <force_delete = true> in the resource aws_autoscaling_group. It's worked for me.

@ZdeAttre, I'm curious why it would work. In my setup, Terraform doesn't attempt to delete the ASG; it just stumbles on deleting the service. Interestingly, the web UI doesn't show the service.

akuzminsky avatar Jun 29 '24 17:06 akuzminsky