Skip to content

Ability to apply without plan

We have usecases where we want to Apply Terraform Modules directly, without creating a dedicated plan before (the behaviour when you just run terraform applyvia CLI and get an impicit plan).

Currently the use the following workaround to do this:

variables:
  TF_PLAN_CACHE: --auto-approve

By overwriting the TF_PLAN_CACHE with any valid paramter, terraform just creates an implicit plan and executes it.

What is the problem with execute Plan and apply in two jobs:

  • Pipelines are taking longer
  • Apply is not atomic. Between the plan and apply, there could be another parallel pipeline that creates a new plan. This could not be solved via resource_names, as it's not a single job.

I think there should be an option to directly run an Apply without needing to generate a plan first.

Edited by Jan Dittrich