Commit fbf6481b authored by Dom Does's avatar Dom Does Committed by Pierre Smeyers
Browse files

fix: remove -auto-approve from apply jobs with upstream plans

The -auto-approve option is ignored when a plan is present, as explained by the
[documentation](https://developer.hashicorp.com/terraform/cli/commands/apply#auto-approve). When
this option is present for a Terraform Enterprise/Cloud setup, the apply command is never run, and
the CLI job times out. Considering the option is ignored (also by [older
versions](https://developer.hashicorp.com/terraform/cli/v1.1.x/commands/apply#auto-approve)),
removing the option entirely seems to be the best solution.
parent 6ba83d40
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -880,7 +880,7 @@ stages:

    if [[ "$tf_plan" ]]; then
      log_info "--- applying upstream plan: \\e[33;1m${tf_plan}\\e[0m"
      terraform apply -auto-approve "$tf_plan"
      terraform apply "$tf_plan"
    else
      # implicit tfvars
      env_vars=$(ls -1 "${environment_type}.env.tfvars" 2>/dev/null || ls -1 "${environment_type}.env.tfvars.json" 2>/dev/null || echo "")