Skip to main content

atmos terraform source delete

Use this command to delete the vendored source directory for a Terraform component. This removes the component directory that was created by atmos terraform source pull.

Source-Based Version Pinning

Learn how to configure the source field for per-environment version control.

atmos terraform source delete --help

Usage

atmos terraform source delete <component> --stack <stack> --force

Description

The delete command removes the vendored component directory. For safety, this command requires the --force flag to confirm deletion.

This is useful for:

  • Cleaning up vendored components before re-vendoring
  • Removing components that are no longer needed
  • Resetting to a clean state for troubleshooting

Examples

Delete Vendored Component

Remove a vendored component directory:

atmos terraform source delete vpc --stack dev --force

Output:

Deleting directory: components/terraform/vpc
✓ Successfully deleted: components/terraform/vpc

Without Force Flag

Attempting to delete without --force shows an error:

atmos terraform source delete vpc --stack dev

Output:

Error: --force flag is required

Explanation: Deletion requires --force flag for safety

Hint: Use --force to confirm deletion

Arguments

component
Required. The name of the Atmos component to delete.

Flags

--stack / -s
Required. The Atmos stack name. Can also be set via ATMOS_STACK environment variable.
--force / -f
Required. Confirm deletion. Without this flag, the command fails for safety.

Safety

The delete command has several safety features:

  1. Requires --force - Prevents accidental deletion
  2. Only deletes source-managed components - Only works on components with source configured
  3. Non-destructive on missing directories - Shows a warning if the directory doesn't exist instead of failing

See Also