aws_s3_object cost estimation
An S3 object is billed for the bytes it stores at its storage class rate, plus the request to upload it, so cost scales with object size and how many objects you keep.
An aws_s3_object uploads a single object into a bucket. Unlike most blueprint resources, an object is not free: it stores real bytes, and S3 bills per GB-month for stored data at the object's storage class rate. A one-off object of a few kilobytes rounds to nothing, but managing many objects or large payloads through Terraform adds up at the bucket's storage rate.
The charges on an object are three: storage per GB-month for as long as it exists (about $0.023/GB-month on S3 Standard), a request charge when it is uploaded (a PUT is about $0.005 per 1,000), and, if it is ever downloaded out of AWS, data transfer egress. Storage class matters: the same bytes cost far less on Standard-IA or Glacier, though those classes add retrieval costs and minimum durations. If the bucket uses SSE-KMS, each object upload also triggers a KMS request charge.
Using aws_s3_object for configuration files, small assets, or Lambda deployment packages is fine and cheap. It becomes a cost concern when Terraform manages large files or many objects, since each is stored and billed like any other S3 data. c3x prices the object's stored bytes at the bucket's storage class rate and folds it into the bucket total, rather than treating uploads as free.
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "aws_s3_object" "config" {
bucket = aws_s3_bucket.assets.id
key = "config/app.json"
source = "${path.module}/files/app.json"
etag = filemd5("${path.module}/files/app.json")
storage_class = "STANDARD"
}Pricing dimensions
What you actually pay for when you provision aws_s3_object.
| Dimension | Unit | What's being charged |
|---|---|---|
| Object storage | per GB-month | The bytes the object stores, billed at its storage class rate for as long as it exists. S3 Standard: $0.023/GB-month |
| Upload request | per 1,000 requests | Each PUT or COPY that writes the object incurs a request charge. PUT: $0.005/1,000 |
| Egress on download | per GB | Data transfer out of AWS when the object is downloaded to the internet. First 10 TB: ~$0.09/GB |
Optimization tips
Common ways to reduce aws_s3_object cost without changing the workload.
Pick the right storage class
Up to 95% for cold objectsObjects that are written once and rarely read cost far less on Standard-IA or Glacier. Set storage_class on the object or let a lifecycle rule transition it.
Do not store large binaries in Terraform state
Managing many large objects with aws_s3_object bloats state and stores real GB-month data. For big or numerous files, upload out of band and let lifecycle rules manage them.
Compress before upload
Storage and egress are billed per GB. Compressing text, logs, and JSON before uploading reduces both the stored bytes and any download transfer cost.
FAQ
Does an S3 object cost money?
Yes. An object stores real bytes billed per GB-month at its storage class rate, plus a small request charge to upload it and egress if it is downloaded out of AWS. Tiny objects round to near zero.
How is the cost of an S3 object calculated?
Storage is size times the per GB-month rate for its storage class (about $0.023 on Standard). Add the PUT request charge on upload and any egress on download. Storage is the dominant cost for large or long-lived objects.
How do I make S3 objects cheaper?
Store cold objects in Standard-IA or Glacier, compress data before upload, and use lifecycle rules to expire objects you no longer need so you stop paying storage for them.
Related resources
Estimate this resource in your own Terraform
Free, open source, no API key. C3X parses your Terraform and shows line-item cost for every resource, including aws_s3_object.