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:
Skip Applying Phase
Add the environment variable
SPACELIFT_SKIP_APPLYINGand set it totrueto skip the apply phase.
Skip Destroying Phase
Add the environment variable
SPACELIFT_SKIP_DESTROYINGand set it totrueto 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.