Skip to content

Instantly share code, notes, and snippets.

@activeshadow
Created February 14, 2019 21:05
Show Gist options
  • Save activeshadow/7ede6ba0412392ddc70cdf53926867f0 to your computer and use it in GitHub Desktop.
Save activeshadow/7ede6ba0412392ddc70cdf53926867f0 to your computer and use it in GitHub Desktop.
Remove AWS WAF IP Sets
#!/bin/bash
SETS=$(aws waf list-ip-sets | jq -r ".IPSets[] | .IPSetId")
for ipset in $SETS; do
TOKEN=$(aws waf get-change-token | jq -r .ChangeToken)
aws waf delete-ip-set --ip-set-id $ipset --change-token $TOKEN
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment