Skip to content
👷 The Terragrunt website redesign is Work In Progress! 👷
For a list of outstanding TODOs see this.
To give feedback, click here.

delete

Usage

Delete backend state used by a unit.

Examples

Delete backend state for the current unit.

Terminal window
terragrunt backend delete

Delete backend state for the current unit without confirmation.

Terminal window
terragrunt backend delete --non-interactive

Delete backend state for the current unit, even if it doesn't have versioning enabled.

Terminal window
terragrunt backend delete --force

Delete State

Using this command deletes the backend state file for the current Terragrunt unit.

For example, given the following remote_state block:

terragrunt.hcl
remote_state {
backend = "s3"
config = {
bucket = "mybucket"
key = "path/to/my/key"
region = "us-east-1"
encrypt = true
dynamodb_table = "tf-lock"
accesslogging_bucket_name = "mybucket-logs"
}
}

Running terragrunt backend delete will delete the backend state file located at path/to/my/key in the mybucket bucket.

Flags

--all

When this flag is set Terragrunt will delete the backend state for all units discovered in the current working directory.

Type: bool

Environment Variables:

  • TG_ALL

--config

Path to the Terragrunt configuration file to use to delete the resources.

Type: string

Environment Variables:

  • TG_CONFIG

--download-dir

Path to download OpenTofu/Terraform modules into. The default is `.terragrunt-cache`.

Type: string

Environment Variables:

  • TG_DOWNLOAD_DIR

--force

When this flag is set, Terragrunt will delete the backend state regardless of whether the bucket containing it has versioning enabled.

Type: bool

Environment Variables:

  • TG_FORCE