Support overriding -lock and other Terraform CLI flags in plan step via TF_CLI_ARGS_plan
complete
S
Shamrock Wildebeest
Currently, when running terraform plan in Harness, the -lock=true flag is enforced in the command, and attempts to override it via TF_CLI_ARGS_plan environment variable do not take effect.
We attempted to override the -lock flag by setting TF_CLI_ARGS_plan=-lock=false both as an environment variable and as a stage variable. However, the argument shown in the command in step logs remains -lock=true, and the state still gets locked during the plan step.
This will allow teams to control locking behavior during plan (e.g., disable locking for read-only plan runs while keeping it enabled for apply runs).
Without this capability, plan steps in Harness unnecessarily lock the state, potentially blocking other operations.
Log In
Rohit Reddy
marked this post as
complete
Rohit Reddy
This should now be supported and generally available.
S
Shamrock Wildebeest
We also need to override the -refresh flag.