Skip to content

Instantly share code, notes, and snippets.

@amcginlay
Last active July 26, 2023 10:45
Show Gist options
  • Save amcginlay/7a9282359ac1772ecfd586872ad29932 to your computer and use it in GitHub Desktop.
Save amcginlay/7a9282359ac1772ecfd586872ad29932 to your computer and use it in GitHub Desktop.
command for listing all ARNs in current account
for region in $(aws ec2 describe-regions --query 'Regions[*].[RegionName]' --output text); do
# echo "--- ${region} ---"
aws resourcegroupstaggingapi get-resources \
--region ${region} \
# --resource-type-filters 'ec2:instance' \
--query 'ResourceTagMappingList[*].[ResourceARN]' \
--output text;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment