Last active
September 29, 2021 11:40
-
-
Save RobertPaulson90/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.
This file contains hidden or 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
# 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