Skip to content

Daily

Track S3 bucket sizes daily

A daily email with each bucket's size and object count, warning you when one passes your limit.

Runs
Daily
Apps
AWS
AI
Not needed
Access
s3:ListAllMyBuckets, cloudwatch:GetMetricStatistics

Send this to your assistant

Create a ClickRuntime automation: every day at 9am, email me the size and object count of each of my S3 buckets and warn me if any is over 100 GB.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

S3 feels cheap until it is not. A team stores user uploads, nightly database backups, application logs and old build artifacts in a dozen buckets. Nobody deletes anything, lifecycle rules were never configured, and the logs bucket grows by hundreds of gigabytes a month. The first time anyone looks at bucket size is when the storage line on the bill has tripled, and cleaning up then means a tense afternoon of deciding what is safe to remove.

Each day, ClickRuntime lists your buckets and reads the BucketSizeBytes and NumberOfObjects metrics that AWS publishes to CloudWatch. It emails a table with each bucket's size and object count, and adds a warning next to any bucket that has passed the size limit you chose.

Engineering managers and platform teams use it to keep storage growth under watch without building a dashboard.

What you get out of it

  • Runaway growth is visible early

    A log bucket gaining fifty gigabytes a day is easy to see in a daily table and invisible in a monthly bill. You can add a lifecycle rule while the cleanup is still small.

  • Limits turn into warnings you can act on

    Setting a ceiling for each bucket means the email tells you when something crosses it. You decide whether to archive, expire or raise the limit with the facts in front of you.

  • Unused buckets get noticed

    A staging bucket from a finished project still costs money every day. A list of all buckets with sizes reminds you which ones nobody has touched and which can safely be removed.

  • Object counts reveal hidden problems

    A sudden jump in the number of objects can mean a bug is writing millions of tiny files. Object count catches that even when total size looks fine. Catching that early prevents a large and confusing bill later.

  • Storage budgets can be defended

    When finance asks why storage costs rose, you have a record of growth by bucket from the daily emails. The explanation is a fact, not a guess. The explanation comes from a record, not a guess.

How it works

What happens, step by step

  1. Every day ClickRuntime lists your S3 buckets.

  2. It reads each bucket's size and number of files from AWS's storage figures.

  3. Buckets over the size limit you set are marked with a warning.

  4. The list arrives in your inbox, largest concerns first.

Before it runs live

  • Connect AWS

What you get

RunsDaily
Track S3 bucket sizes dailytoday, 9:00Succeeded
Email · S3 bucket sizesWARNING acme-backups: 132.4 GB, 18,220 objects acme-uploads: 6.8 GB, 2,410 objects

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Run it at a different time, more or less often, or only on weekdays
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other AWS steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
get_a_daily_report_of_s3_bucket_sizes.pyexample
from datetime import datetime, timedelta, timezone
import boto3
from clickruntime import on_trigger, credentials, notify

REGION = "us-east-1"

def aws(service):
    return boto3.client(service, region_name=REGION, aws_access_key_id=credentials.secret("AWS_ACCESS_KEY_ID"),
                        aws_secret_access_key=credentials.secret("AWS_SECRET_ACCESS_KEY"))

WARN_GB = 100

def metric(cw, bucket, name, storage):
    points = cw.get_metric_statistics(Namespace="AWS/S3", MetricName=name, Period=86400, Statistics=["Average"],
                                      StartTime=datetime.now(timezone.utc) - timedelta(days=2), EndTime=datetime.now(timezone.utc),
                                      Dimensions=[{"Name": "BucketName", "Value": bucket}, {"Name": "StorageType", "Value": storage}])["Datapoints"]
    return max(points, key=lambda p: p["Timestamp"])["Average"] if points else 0

@on_trigger
def run(event):
    cw, lines = aws("cloudwatch"), []
    for b in aws("s3").list_buckets()["Buckets"]:
        gb = metric(cw, b["Name"], "BucketSizeBytes", "StandardStorage") / 1e9
        objects = metric(cw, b["Name"], "NumberOfObjects", "AllStorageTypes")
        lines.append(f"{'WARNING ' if gb > WARN_GB else ''}{b['Name']}: {gb:,.1f} GB, {objects:,.0f} objects")
    notify.email_me("S3 bucket sizes", "\n".join(lines))
    return {"buckets": len(lines)}

FAQ

Common questions

Why do the metrics sometimes look a day old?
S3 storage metrics in CloudWatch are reported once per day, not in real time, so a bucket's size reflects the most recent daily measurement. That is accurate enough for trend watching, but it will not show an upload that happened an hour ago.
Does it need access to the files in the buckets?
No. It reads bucket names and CloudWatch metrics only, so it does not open or list your objects. A policy allowing s3:ListAllMyBuckets and cloudwatch:GetMetricStatistics is enough, which keeps the permissions narrow. Nothing inside the files is read.
Can different buckets have different limits?
Yes. Limits can be set per bucket, so a backups bucket might be allowed 2 TB while a thumbnails bucket is held to 100 GB. Tell your AI assistant the limits and the warnings in the email will follow them.
What permissions does it need?
s3:ListAllMyBuckets, cloudwatch:GetMetricStatistics. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (daily). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Track S3 bucket sizes daily” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.