Skip to content

Instantly share code, notes, and snippets.

@coulterpeterson
Last active June 25, 2025 14:39
Show Gist options
  • Save coulterpeterson/99fc6e65a295ee4d879cf34015241f5f to your computer and use it in GitHub Desktop.
Save coulterpeterson/99fc6e65a295ee4d879cf34015241f5f to your computer and use it in GitHub Desktop.
AWS CLI Script to Detect Regions with DynamoDB Tables
#!/bin/bash
# Usage: bash check_dynamo_regions.sh
echo "Checking DynamoDB tables in all AWS regions..."
# Get list of enabled regions
regions=$(aws ec2 describe-regions --query "Regions[*].RegionName" --output text)
for region in $regions; do
echo "🔍 Region: $region"
table_count=$(aws dynamodb list-tables --region $region --query "TableNames" --output text | wc -w)
if [ "$table_count" -gt 0 ]; then
echo "✅ Found $table_count table(s) in $region"
aws dynamodb list-tables --region $region --output text
echo ""
else
echo "❌ No tables in $region"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment