Skip to content

Instantly share code, notes, and snippets.

@kmcquade
Created April 23, 2021 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmcquade/cfa5568686347fbe39e3ce31a27fc22f to your computer and use it in GitHub Desktop.
Save kmcquade/cfa5568686347fbe39e3ce31a27fc22f to your computer and use it in GitHub Desktop.
resource "null_resource" "nuke" {
# Because we set this to timestamp, it *always* runs :D
triggers = {
party_like_its_jan_1_1970 = timestamp()
}
provisioner "local-exec" {
command = <<EOF
for sub in `az account list | jq -r '.[].id'`; do \
for rg in `az group list --subscription $sub | jq -r '.[].name'`; do \
az group delete --name $rg --subscription $sub --no-wait --yes; \
done; \
done;
EOF
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment