Skip to content

Instantly share code, notes, and snippets.

@binaryPUNCH
Last active September 29, 2021 11:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save binaryPUNCH/3925ac24b0fa899b9fc3d2b5c2c9606b to your computer and use it in GitHub Desktop.
Save binaryPUNCH/3925ac24b0fa899b9fc3d2b5c2c9606b to your computer and use it in GitHub Desktop.
Quick'n'dirty PowerShell script to delete ALL rules for "AWS Config". Yeah, cause that's hella expensive apparently and the Management Console doesn't allow you to delete them all at once... This obviously relies on the AWS CLI.
# DANGER. DON'T RUN UNLESS YOU REALLY WANT TO DELETE ALL YOUR AWS CONFIG RULES.
$deserialized = aws configservice describe-config-rules | ConvertFrom-Json
$arr = $deserialized.ConfigRules | select -ExpandProperty ConfigRuleName
foreach($x in $arr) {
# if your API keys aren't setup you may want to add them in the script
aws configservice delete-config-rule --config-rule-name $x | write-host
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment