Skip to content

Refreshing an ECS service takes a long time if deleted #44277

@pauldraper

Description

@pauldraper

Terraform and AWS Provider Version

Terraform v1.6.6
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v5.87.0

Affected Resource(s) or Data Source(s)

  • aws_ecs_service

Expected Behavior

Refreshing a deleted ECS services takes a few seconds.

Actual Behavior

Refreshing a deleted ECS services takes multiple minutes.

Relevant Error/Panic Output

No response

Sample Terraform Configuration

Click to expand configuration
resource "aws_ecs_service" "mongo" {
  name            = "mongodb"
  cluster         = aws_ecs_cluster.foo.id
  task_definition = aws_ecs_task_definition.mongo.arn
  desired_count   = 3
  iam_role        = aws_iam_role.foo.arn
  depends_on      = [aws_iam_role_policy.foo]
}

Steps to Reproduce

  1. Create an ECS service via Terraform.
  2. Delete the ECS service manually.
  3. Run terraform plan -refresh-only.

Step #3 will take multiple minutes.

Debug Logging

No response

GenAI / LLM Assisted Development

n/a

Important Facts and References

Refreshing an ECS service does not take long if it is (1) not in the state or (2) not deleted.

Would you like to implement a fix?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAddresses a defect in current functionality.needs-triageWaiting for first response or review from a maintainer.service/ecsIssues and PRs that pertain to the ecs service.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions