Skip to content

Instantly share code, notes, and snippets.

@nbr23
nbr23 / aws_ecr_stats.sh
Last active November 18, 2024 05:06 — forked from RafaelWO/awc_ecr_stats.sh
AWS: Calculate the size of all ECR repositories
repos=""
sizes=""
name_lens=""
image_counts=""
# Check if user is logged in
if ! aws sts get-caller-identity &> /dev/null; then
echo "ERROR: Seems like your SSO session is invalid. Please run"
printf "\n $ aws sso login\n\n"
echo "before you run the script."