Last active
June 25, 2025 14:39
-
-
Save coulterpeterson/99fc6e65a295ee4d879cf34015241f5f to your computer and use it in GitHub Desktop.
AWS CLI Script to Detect Regions with DynamoDB Tables
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
#!/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