问题
Is there any way to change the terraform default timeouts?
For example on terraform apply
I frequently timeout trying to destroy autoscaling groups:
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
If I re-run the terraform apply, it works. It seems like the timeout is 10 minutes -- I'd like to double the time so that it finishes reliably. Alternatively, is there a way to get the auto scaling groups to delete faster?
回答1:
You can add a timeout to a specific resource inside terraform
timeouts {
create = "60m"
delete = "2h"
}
https://www.terraform.io/docs/configuration/resources.html
回答2:
i have the same problem when i try to delete autoscaling-group with terraform destroy
I solve the problem with add the follow lines on my resource creation section:
timeouts {
delete = "60m"
}
来源:https://stackoverflow.com/questions/44092511/terraform-autoscaling-group-destroy-timeouts