Skip to content

get_terraform_commands_that_need_locking

unitstack

Usage

get_terraform_commands_that_need_locking() --> list(string)

get_terraform_commands_that_need_locking returns apply, destroy, import, plan, refresh, taint, and untaint. Use it as the commands of an extra_arguments block that passes -lock-timeout, e.g. to wait up to 20 minutes for another run’s state lock:

terragrunt.hcl
terraform {
extra_arguments "retry_lock" {
commands = get_terraform_commands_that_need_locking()
arguments = ["-lock-timeout=20m"]
}
}

Examples

terragrunt.hcl
locals {
commands = get_terraform_commands_that_need_locking()
# ["apply", "destroy", "import", "plan", "refresh", "taint", "untaint"]
}