0Pricing
AWS Solutions Architect · Lesson

Buckets, Objects, and Regions

Create S3 buckets, upload objects, understand key naming, and see how S3 replicates data within a Region.

Buckets, Objects, and Regions is a free AWS Solutions Architect lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the AWS Solutions Architect learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

What Is Amazon S3?

Amazon Simple Storage Service (S3) is AWS's object storage service designed to store and retrieve any amount of data from anywhere on the internet. S3 provides 11 nines of durability (99.999999999%) by redundantly storing objects across multiple devices in multiple Availability Zones within the selected Region. It is infinitely scalable, has no capacity limit, and supports objects from 0 bytes up to 5 TB. S3 is the backbone of countless AWS architectures—serving static websites, data lakes, backup repositories, and more.

S3 Buckets: The Top-Level Container

An S3 bucket is a globally unique named container for objects. Buckets are created in a specific AWS Region, but their names must be globally unique across all AWS accounts worldwide (because the name becomes part of the URL). Bucket names must be 3–63 characters, lowercase, start with a letter or number, and contain no underscores or uppercase letters. Best practice: include your account ID or a random suffix to avoid name collisions with other accounts.

# Create an S3 bucket in a specific region
aws s3api create-bucket \
  --bucket my-company-data-20240101 \
  --region us-west-2 \
  --create-bucket-configuration LocationConstraint=us-west-2

S3 Objects and Keys

An object in S3 consists of the data (the file content), a key (the object's unique name within the bucket), metadata (system and user-defined key-value pairs), and optionally a version ID (if versioning is enabled). The key is the full path-like string, e.g., photos/2024/summer/beach.jpg. S3 is flat—there are no real directories, only key prefixes that look like directories. The maximum object size is 5 TB; for objects larger than 100 MB, use Multipart Upload for better performance and reliability.

# Upload an object
aws s3 cp ./report.pdf s3://my-company-data-20240101/reports/2024/report.pdf

# List objects with a specific prefix
aws s3 ls s3://my-company-data-20240101/reports/2024/

S3 URL Formats

S3 objects can be accessed via two URL formats. Path-style: https://s3.<region>.amazonaws.com/<bucket>/<key> (being deprecated for new buckets). Virtual-hosted-style: https://<bucket>.s3.<region>.amazonaws.com/<key> (current standard). The bucket name becomes a subdomain, which is why bucket names must be DNS-compliant. For pre-signed URLs and CloudFront distributions, you will always see the virtual-hosted format. Understanding the URL structure helps you configure bucket policies and CORS correctly.

# Generate a pre-signed URL valid for 1 hour (3600 seconds)
aws s3 presign s3://my-company-data-20240101/reports/2024/report.pdf \
  --expires-in 3600

S3 Data Consistency Model

As of December 2020, Amazon S3 provides strong read-after-write consistency for all operations—PUTs of new objects, overwrites, and DELETEs—across all Regions automatically, at no additional cost. This means as soon as a write succeeds, any subsequent read will return the latest version of the object. This is a significant improvement from the previous eventual-consistency model and simplifies application design by removing the need for post-write read delays or retry logic.

S3 and Regions: Data Residency

When you create an S3 bucket, you specify a Region, and your data stays in that Region unless you explicitly configure replication. AWS replicates data within that Region across multiple AZs for durability, but does not move data to other Regions automatically. This regional data residency is important for compliance: if regulations require data to stay in the EU, create the bucket in eu-west-1 or another EU Region and your data will not leave.

# Find the region of an existing bucket
aws s3api get-bucket-location \
  --bucket my-company-data-20240101

Multipart Upload for Large Objects

Multipart Upload is required for objects over 5 GB and recommended for objects over 100 MB. It divides the object into parts (5 MB minimum per part, up to 10,000 parts), uploads each part independently (in parallel), and combines them into the final object. If any part fails, you retry only that part. The AWS CLI and SDKs handle multipart upload automatically when you use the aws s3 cp command for large files—you don't need to implement it manually.

# The CLI uses multipart automatically for large files
aws s3 cp large-file-50GB.tar.gz s3://my-bucket/ \
  --storage-class STANDARD

# Or use s3api to control multipart manually
aws s3api create-multipart-upload \
  --bucket my-bucket \
  --key large-file-50GB.tar.gz

S3 Object Metadata

Every S3 object has system metadata set by AWS (Content-Type, Content-Length, ETag, Last-Modified) and optional user-defined metadata (custom key-value pairs prefixed with x-amz-meta-). Metadata is stored with the object and returned in HTTP response headers when the object is downloaded. Content-Type is particularly important for web serving—if you upload an HTML file without setting Content-Type: text/html, browsers may offer it as a download instead of rendering it.

# Upload with explicit Content-Type metadata
aws s3 cp index.html s3://my-website-bucket/ \
  --content-type 'text/html' \
  --metadata 'author=alice,env=production'

S3 for Static Website Hosting

Amazon S3 can serve as a static website host—serving HTML, CSS, JavaScript, images, and other files directly from a bucket. Enable static website hosting in bucket properties, specify an index document (index.html) and optional error document (404.html). The bucket's website endpoint URL follows the format: http://<bucket>.s3-website.<region>.amazonaws.com. For HTTPS and custom domain support, place a CloudFront distribution in front of the S3 static website bucket.

# Enable static website hosting
aws s3api put-bucket-website \
  --bucket my-website-bucket \
  --website-configuration '{"IndexDocument":{"Suffix":"index.html"},"ErrorDocument":{"Key":"404.html"}}'

S3 Transfer Acceleration

S3 Transfer Acceleration speeds up long-distance object uploads by routing data through the nearest CloudFront Edge Location and then over AWS's private backbone network to the S3 bucket's Region. Instead of uploading directly to the S3 endpoint, the client uploads to an accelerated endpoint like my-bucket.s3-accelerate.amazonaws.com. Transfer Acceleration adds a small per-GB charge but can significantly improve upload speeds for users who are geographically far from the bucket's Region.

# Enable Transfer Acceleration on a bucket
aws s3api put-bucket-accelerate-configuration \
  --bucket my-company-data-20240101 \
  --accelerate-configuration Status=Enabled

S3 Object Tagging

Object tags are key-value pairs you attach to S3 objects to categorise and manage them. Tags are used for: lifecycle rules (transition or expire objects with specific tags), access control (IAM and bucket policy conditions on tag values), cost allocation (Cost Explorer tracks S3 spend by tag), and inventory and analytics. Each object can have up to 10 tags. Tags can be added at upload time or updated after the object exists without modifying the object data itself.

# Add tags to an existing object
aws s3api put-object-tagging \
  --bucket my-company-data-20240101 \
  --key reports/2024/report.pdf \
  --tagging '{"TagSet":[{"Key":"env","Value":"production"},{"Key":"owner","Value":"finance"}]}'

Quick Check

Test your understanding of AWS Solutions Architect (SAA-C03) concepts from this lesson.

Lesson Recap

In this lesson you learned: S3 buckets are globally uniquely named containers tied to a specific Region, objects are stored with a flat key structure and support metadata and tags, and S3 provides strong read-after-write consistency and 11 nines of durability through multi-AZ redundancy. Next up we explore S3 Access Control with bucket policies and ACLs.

Frequently asked questions

Is the “Buckets, Objects, and Regions” lesson free?

Yes — the full text of “Buckets, Objects, and Regions” is free to read here on the web, and the AWS Solutions Architect course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the AWS Solutions Architect course, upgrade to CoddyKit PRO.

What will I learn in “Buckets, Objects, and Regions”?

Create S3 buckets, upload objects, understand key naming, and see how S3 replicates data within a Region. You practise AWS Solutions Architect with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start AWS Solutions Architect?

No prior experience is required. AWS Solutions Architect on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Buckets, Objects, and Regions” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this AWS Solutions Architect lesson?

Yes. Every AWS Solutions Architect lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Buckets, Objects, and Regions
  2. S3 Access Control: Bucket Policies and ACLs
  3. Versioning, MFA Delete, and Replication
  4. Storage Classes and Lifecycle Policies
← Back to AWS Solutions Architect