amazon-web-services - 在ecs aws中运行terraform destroy时,它会先删除一个服务,然后需要很长时间才能删除任务
问题描述
我有 3 个运行任务的 ECS 服务,带有 linux docker 容器和轻量级 web 服务。当我运行时terraform destroy
,停止这些任务大约需要 5-6 分钟。
如果在运行时手动停止它们,那么它会继续破坏其他资源。
我的问题是:这是破坏任务的预期时间吗?销毁一个基础ECS集群的整个过程需要8分钟。
使用任务销毁服务的日志:
2019-01-10T17:38:10 [DEBUG] module.ecs.aws_ecs_service.test-service: Still destroying... (ID: arn:aws:ecs:us-east-1:xxxxxxxx:service/test-service, 10s elapsed)
2019-01-10T17:38:11 [DEBUG] plugin.terraform-provider-aws_v1.54.0_x4:
2019-01-10T17:38:11 [DEBUG] Checking if ECS service arn:aws:ecs:us-east-1:xxxxxxxx:service:service/test-service is INACTIVE
2019-01-10T17:38:11 [DEBUG] plugin.terraform-provider-aws_v1.54.0_x4: 2019-01-10T17:38:11 [DEBUG] [aws-sdk-go] DEBUG: Request ecs/DescribeServices Details:
2019-01-10T17:38:11 [DEBUG] plugin.terraform-provider-aws_v1.54.0_x4: 2019/01/10 17:38:11 [DEBUG] [aws-sdk-go] DEBUG: Response ecs/DescribeServices Details:
2019-01-10T17:38:11 [DEBUG] plugin.terraform-provider-aws_v1.54.0_x4: 2019/01/10 17:38:11 [DEBUG] ECS service (arn:aws:ecs:us-east-1:xxxxxxxx:service/test-service) is currently "DRAINING"
2019-01-10T17:38:11 [DEBUG] plugin.terraform-provider-aws_v1.54.0_x4: 2019/01/10 17:38:11 [TRACE] Waiting 10s before next try
就这样循环了大约 6 分钟。如果我去 AWS 控制台,那么我看不到服务,但我看到状态为“正在运行”的任务,如果我手动停止它们,那么销毁过程将继续到下一个阶段。您可以使用此 repo进行尝试,只需确保将 env 变量TF_LOG
设置为至少DEBUG
. 在提供的 repo 中将花费更少的时间,但您会看到相同的行为。
谢谢你看这个。
解决方案
推荐阅读
- java - 从 Groovy 调用 java 方法
- c++ - 可变大小函数中数组的内存注意事项
- javascript - 在 IE 11 和 10 中平滑滚动破坏 CSS 变换矩阵
- javascript - 具有动态列名的对象映射数组
- scala - Higher Kinded Type 参数中的下划线使用规则
- enums - Rust 宏从另一个枚举生成枚举
- json - 如果 || 怎么写 如果在角度
- azure - Azure 数据工厂链接源代码控制的 GitHub 存储库?
- firebase - 如何从 userUid() 获取它到 StreamBuilder Flutter
- javascript - TypeScript/Electron.js 中的导入问题