Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set timeout for terraform apply?

Tags:

terraform

Many a times I get '[TRACE] dag/walk: vertex ' when I apply terraform apply on certain tf. I would like to set timeout instead of going on forever.

Thanks

Several examples - https://github.com/hashicorp/terraform/issues/16458 https://github.com/terraform-providers/terraform-provider-aws/issues/2068

But all of them focus on specific solution. I dont want inifinite loops whatsoever reason I just want a flag for apply that would stop trying after certain time. Iam thinking of an external command to kill it but I want to see if there is actual terraform solution before I implement it.

like image 511
resultsway Avatar asked Nov 07 '22 12:11

resultsway


1 Answers

Today Terraform SDK have special fields for resources timeouts. Official documentation here.

For example, you can add timeouts for some operations in resource description:

resource "<resource_name>" "<resource_name>" {
  ...
  timeouts {
    create: "1h30m",
    update: "2h",
    delete: "20m"
  }
}
like image 98
Dunaevsky Maxim Avatar answered Nov 15 '22 08:11

Dunaevsky Maxim