Skip to main content

atmos terraform clean

purpose

Use this command to delete the .terraform folder, the folder that TF_DATA_DIR ENV var points to, .terraform.lock.hcl file, varfile and planfile for a component in a stack.

atmos terraform clean --help

Usage

Execute the terraform clean command like this:

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

Run atmos terraform clean --help to see all the available options

Examples

atmos terraform clean top-level-component1 -s tenant1-ue2-dev
atmos terraform clean infra/vpc -s tenant1-ue2-staging
atmos terraform clean infra/vpc -s tenant1-ue2-staging --skip-lock-file
atmos terraform clean test/test-component -s tenant1-ue2-dev
atmos terraform clean test/test-component-override-2 -s tenant2-ue2-prod
atmos terraform clean test/test-component-override-3 -s tenant1-ue2-dev

Arguments

ArgumentDescriptionRequired
componentAtmos terraform componentyes

Flags

FlagDescriptionAliasRequired
--stackAtmos stack-syes
--dry-runDry runno
--skip-lock-fileSkip deleting .terraform.lock.hclno