Configuring a Module to Plan Only, Skipping Apply and Destroy Phases

Last updated: November 10, 2024

Overview

In Spacelift, you can configure a module to execute the plan phase only, while skipping the apply and destroy phases. This is useful for testing or validation purposes, where you want to review planned changes without making any modifications to resources.

How to Skip Applying and Destroying Phases

To skip the apply and destroy phases, set the following environment variables in your module environment:

  1. Skip Applying Phase

    • Add the environment variable SPACELIFT_SKIP_APPLYING and set it to true to skip the apply phase.

  2. Skip Destroying Phase

    • Add the environment variable SPACELIFT_SKIP_DESTROYING and set it to true to skip the destroy phase.

By setting both of these variables, the module will run the plan phase only.

Learn more about configuring module test cases in Spacelift.