【问题标题】:terraform autoscaling group destroy timeoutsterraform 自动缩放组销毁超时
【发布时间】:2017-10-20 21:50:14
【问题描述】:

有什么方法可以更改 terraform 默认超时?

例如在terraform apply 上,我经常超时尝试销毁自动缩放组:

module.foo.aws_autoscaling_group.bar (deposed #0): Still destroying... (10m0s elapsed)
Error applying plan:

1 error(s) occurred:

 * aws_autoscaling_group.bar (deposed #0): group still has 1 instances

如果我重新运行 terraform apply,它会起作用。超时似乎是 10 分钟——我想将时间加倍,以便它可靠地完成。或者,有没有办法让 Auto Scaling 组更快地删除?

【问题讨论】:

  • 这对你有用吗?我收到 [ERR] Error decoding timeout: Timeout Key (create) is not supported 用于自动扩展组...您介意分享一下您是如何将其添加到您的 ASG 资源声明中的吗?

标签: amazon-web-services autoscaling terraform


【解决方案1】:

您可以在 terraform 中为特定资源添加超时

 timeouts {
    create = "60m"
    delete = "2h"
  }

https://www.terraform.io/docs/configuration/resources.html

【讨论】:

  • 感谢您的建议,但是(至少对于 Auto Scaling 组尤其如此),我得到:[ERR] Error decoding timeout: Timeout Key (create) is not supported ... 任何提示?
  • asg 中有多少个实例?你能用 asg 资源发布你的 terraform 吗?
  • 对于自动缩放组,答案说支持删除键,但不支持创建键。对于创建超时,您有更复杂的选项——请参阅terraform.io/docs/providers/aws/r/…
【解决方案2】:

当我尝试使用terraform destroy 删除自动缩放组时,我遇到了同样的问题 我通过在资源创建部分添加以下行来解决问题:

    timeouts {  
    delete = "60m"
  }

【讨论】:

    猜你喜欢
    • 2018-02-10
    • 2021-06-16
    • 1970-01-01
    • 2021-10-26
    • 2021-09-08
    • 1970-01-01
    • 2012-02-06
    • 2021-04-12
    • 2021-08-22
    相关资源
    最近更新 更多