Skip to content
Aa

Terraform — Remove

Run cleanup only when you choose to retire your Terraform deployment. Review the saved destruction plan: it must contain only resources owned by this state, with no namespace or xcsh resource deletion.

Terminal window
terraform -chdir="$XCSH_WORKDIR/deployment" plan -destroy \
-out="$XCSH_WORKDIR/deployment/destroy.plan"
terraform -chdir="$XCSH_WORKDIR/deployment" show \
"$XCSH_WORKDIR/deployment/destroy.plan"
shasum -a 256 "$XCSH_WORKDIR/deployment/destroy.plan"

Confirm the exact owned resources and saved-plan hash before running the apply command.

Terminal window
terraform -chdir="$XCSH_WORKDIR/deployment" apply \
"$XCSH_WORKDIR/deployment/destroy.plan"
unset XCSH_API_TOKEN

See the input and lifecycle reference for protected files, write-only values, import, drift, and key-algorithm cutovers.