Skip to content

Instantly share code, notes, and snippets.

@johanforssell
Last active March 28, 2024 07:41
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 johanforssell/16afa0f540a08576ddbdb44deadf81cc to your computer and use it in GitHub Desktop.
Save johanforssell/16afa0f540a08576ddbdb44deadf81cc to your computer and use it in GitHub Desktop.
Use the AWS CLI to delete all Route53 query logging configs
#!/bin/sh
# Make sure you're authenticated to use the AWS CLI.
#
# List all Route 53 query logging configs, iterate over their Ids and delete them.
# The call to jq flattens the list of configs down to just the list of Ids.
#
aws route53 list-query-logging-configs \
| jq -r '.[][]|[.Id]|@tsv' \
| xargs -L1 -I'{}' aws route53 delete-query-logging-config --id '{}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment