Which flags make `apply` safer in automation?
IntermediateConceptWorkflow and CLI
Answer
-input=false (never prompt), -lock-timeout=5m (wait for the lock rather than failing), -parallelism=N (tune concurrency against API rate limits), and applying a saved plan file instead of -auto-approve on a fresh plan. Combine with TF_IN_AUTOMATION=1.
More on Workflow and CLI
What does `terraform init` do?BeginnerWhat does `terraform plan` do?BeginnerWhat does `terraform apply` do and what is `-auto-approve`?BeginnerWhat does `terraform destroy` do?BeginnerWhat do `terraform fmt` and `terraform validate` check?BeginnerWhy save a plan with `-out` and apply that file?Intermediate