Created
April 23, 2021 20:36
-
-
Save kmcquade/cfa5568686347fbe39e3ce31a27fc22f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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