Skip to content

Instantly share code, notes, and snippets.

@thomashartm
Last active June 19, 2024 08:47
Show Gist options
  • Save thomashartm/38c25c12abda4d5425a4235530e99e5c to your computer and use it in GitHub Desktop.
Save thomashartm/38c25c12abda4d5425a4235530e99e5c to your computer and use it in GitHub Desktop.
Removes a terragrunt state for a group of resources that contain the provided argument
#!/bin/bash
# usage:
# ./remove-terragrunt-state module.s3_bucket ../../../
TOKEN=$1
SOURCE=$2
terragrunt state rm $(terragrunt state list --terragrunt-source ../../../ | grep $TOKEN) --terragrunt-source $SOURCE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment