Skip to content

Instantly share code, notes, and snippets.

@paulbrodner
Last active October 15, 2019 09:05
Show Gist options
  • Select an option

  • Save paulbrodner/86679805054a07c7be32e4e5a159bcfc to your computer and use it in GitHub Desktop.

Select an option

Save paulbrodner/86679805054a07c7be32e4e5a159bcfc to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# change region here
REGIONS=(eu-west-1 us-east-1)
for region in "${REGIONS[@]}"; do
echo "Resources with no tags in region: $region"
export AWS_DEFAULT_REGION=$region
aws resourcegroupstaggingapi get-resources | jq '.ResourceTagMappingList' | jq '.[] | select((.Tags|length) == 0) | {resource: .ResourceARN }'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment