Skip to content

v1.114.0

Compare
Choose a tag to compare
@cloudposse-releaser cloudposse-releaser released this 05 Dec 02:21
· 41 commits to refs/heads/main since this release
382de94
Add `--everything` and `--force` flags to the `atmos terraform clean` command @haitham911 (#727)

What

  • Add --everything and --force flags to the atmos terraform clean command to delete the Terraform-related folders and files, including:
    • backend.tf.json
    • .terraform
    • terraform.tfstate.d
    • .terraform.lock.hcl

The following scenarios are covered:

  1. If no component is specified:
    atmos terraform clean --everything deletes all state files for all Terraform components and requires a confirmation from the user
    atmos terraform clean --everything --force deletes all state files for all Terraform components without a confirmation from the user

  2. If a specific component is specified:
    atmos terraform clean <component> --everything - deletes the state files for the specified component

  3. If both a component and a stack are specified:
    atmos terraform clean <component> --stack<stack> --everything - deletes the state files for the specified component and stack

Why

  • Cleaning state files is useful when running tests (it should not be the default behavior to avoid unintended data loss)

Usage

atmos terraform clean <component> -s <stack> [--skip-lock-file] [--everything] [--force]