Amazon S3 Buckets

Beginner
10 min read
Updated: Nov 2026
5 examples
S3 / IAM / console

Definition and Usage

Amazon Simple Storage Service (S3) is object storage for files, images, logs, backups, and static site artifacts. In this guide you create a bucket, upload a test object, and attach a minimal bucket policy so the object’s URL loads anonymously in a browser.

What is an S3 bucket?

A bucket is a regional container for objects. Each object has a key (path-like name) and is addressed by API calls such as PutObject and GetObject—not as a classical file system.

When should you use this walkthrough?

Use it to learn console basics and how Principal: "*" policies interact with Block Public Access. For production web apps, prefer private buckets with CloudFront and Origin Access Control, or presigned URLs.

What you will build

A sandbox bucket, a sample image upload, a public-read GetObject policy, and a working Object URL in the browser. Next, pull objects locally with Download files from S3.

S3 next to compute

Apps on EC2 or behind an Application Load Balancer often store user uploads or marketing assets in S3 while the app serves HTML and APIs.

Learning path, not production defaults.

You will briefly allow public read for static assets such as images. Do not upload private user data to this bucket.

Production caution.

A fully public read bucket is rarely right for private data. Prefer private buckets with CloudFront OAC, presigned URLs, or IAM-authenticated access.

Durability vs security.

S3 is built for extreme durability across AZs. You still choose encryption, lifecycle rules, and least-privilege policies.

Core Concepts

Terms you will use while working with S3:

ConceptMeaning
BucketRegional container with a globally unique name
Object keyFull path-like name of a file inside the bucket
Block Public AccessAccount/bucket switches that can block anonymous policies
Bucket policyJSON resource policy attached to the bucket
s3:GetObjectPermission required to download or view an object
Object URLHTTPS link to an object in the console
ACLsLegacy per-object permissions; usually keep disabled
Versioning / lifecycleRetain variants and expire or transition storage classes

Prerequisites

Have these ready before you create a bucket:

  • An AWS account with permission to create buckets and edit policies (for example s3:CreateBucket, s3:PutBucketPolicy, and object write actions).
  • Access to the S3 console in a non-production or sandbox account.
  • A sample image or file you are comfortable making publicly readable for this lab.

Examples

Create a bucket, upload an object, attach a public-read policy, and open the Object URL.

Example 1 — Create an S3 Bucket

Pick a globally unique name and Region, then create the bucket.

  1. Sign in to the AWS Management Console and open S3.
  2. Choose Create bucket.
  3. Under General configuration, type a unique Bucket name (for example my-company-assets-dev) and choose an AWS Region.
  4. Under Object Ownership, keep ACLs disabled (recommended) unless you have a legacy ACL workflow.
S3 console with Create bucket button
Amazon S3
S3 bucket general configuration name and Region
Amazon S3
S3 object ownership ACLs disabled recommended
Amazon S3

How It Works

  1. Bucket names are global and DNS-like across all AWS accounts.
  2. Region decides where objects live and which endpoints you use.
  3. ACLs disabled pushes you toward bucket policies and IAM.
  4. Create bucket is empty until you upload keys.

Example 2 — Allow Public Access for the Lab

Clear Block all public access so a Principal: "*" policy can grant anonymous reads.

  1. Under Block Public Access settings, clear Block all public access.
  2. Acknowledge the warning.
  3. Leave other defaults unless your organisation requires encryption or versioning from day one, then choose Create bucket.
S3 Block Public Access settings for the bucket
Amazon S3
Only for non-sensitive lab data.

This exposes only what your bucket policy explicitly allows—still verify you are not uploading secrets or private user files.

How It Works

  1. Block Public Access can ignore public policies even if JSON looks correct.
  2. Clearing the switch does not publish objects by itself—you still need a policy.
  3. Production usually keeps BPA on and uses CloudFront OAC instead.
  4. Account-level BPA can still override a bucket if your org locked it down.

Example 3 — Upload Objects

Add a sample file into the empty bucket.

  1. Open the bucket from the bucket list.
  2. Choose Upload and add one or more files (for example a PNG or JPEG).
  3. Review permissions and properties, then choose Upload at the bottom of the wizard.
S3 bucket upload button in the console
Amazon S3
S3 upload wizard files and folders ready to upload
Amazon S3

How It Works

  1. Upload creates objects with keys that look like folder paths in the UI.
  2. Prefixes are not real directories—they are part of the key string.
  3. Without a public policy, Object URLs still return Access Denied to anonymous users.
  4. CLI sync is covered next in Download from S3 (and reverse uploads).

Example 4 — Attach a Public Read Bucket Policy

Allow anonymous s3:GetObject on all objects in the bucket.

  1. Stay in the bucket and open the Permissions tab.
  2. Scroll to Bucket policy and choose Edit.
  3. Paste a policy that allows anonymous s3:GetObject. Replace your-bucket-name with your exact bucket name.
  4. Save the policy. If the console reports errors, confirm the JSON is valid and the ARN matches.
Bucket policy (JSON)
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": "*",
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::your-bucket-name/*"
    }
  ]
}

How It Works

  1. Principal "*" means any anonymous caller on the internet.
  2. Resource ends with /* so every object key is covered.
  3. Bucket policies attach to the resource; IAM policies attach to identities.
  4. Narrow the Resource later if only a prefix should be public.

Example 5 — Test the Object URL

Confirm anonymous HTTPS access in a browser.

  1. Open the Objects list inside the bucket.
  2. Select an object you uploaded.
  3. Under Object URL, copy the HTTPS link or open it in a new tab.
  4. When the policy is correct, the image or file loads without signing in.
S3 object details showing Object URL
Amazon S3
Browser displaying an image loaded from S3 object URL
Browser

How It Works

  1. Object URL is a quick smoke test for GetObject.
  2. Access Denied usually means BPA, wrong ARN, or an explicit deny.
  3. Next upgrades: CloudFront, static website hosting, or lifecycle rules for cost control.
  4. CLI downloads of the same objects: Download files from S3.

Edge Cases & Pitfalls

Most Access Denied cases are Block Public Access, ARN typos, or account-level locks.

bpa

Policy saved but still private

Block Public Access (bucket or account) can ignore public statements. Clear the relevant switches for this lab only.

arn

Wrong bucket name in the ARN

The Resource must be arn:aws:s3:::exact-bucket-name/*. A typo yields Access Denied.

name

Bucket name already taken

Names are globally unique. Add an account or project suffix and retry.

data

Sensitive files in a public lab bucket

Delete the objects, tighten the policy, and re-enable Block Public Access when the lab ends.

acl

Mixing ACLs and policies

Prefer bucket policies with ACLs disabled. Per-object ACLs are harder to audit.

cdn

Serving the internet from the S3 website endpoint

For real sites, put CloudFront in front and keep the bucket private with OAC.

Key Takeaways

  • Buckets are regional; object keys form the logical path inside.
  • Block Public Access must allow your intent before Principal: "*" works.
  • Object URL is a smoke test; production usually stays private + CDN.
  • Next: CLI downloads, CloudFront, versioning, and lifecycle rules.

One line: create bucket, upload, allow GetObject in policy (lab only), then test the Object URL.

Frequently Asked Questions

It allows you to attach bucket policies or object ACLs that grant anonymous or cross-account access. AWS warns because accidental public data exposure is common; use private buckets with CloudFront origin access controls or signed URLs for production web apps.
A bucket policy is attached to the bucket resource in S3 and can allow or deny principals including anonymous users. IAM policies attach to users, groups, or roles and control what identities can do across AWS services, including specific S3 actions on ARNs you list.
In the S3 console, open the object and copy the Object URL. It only works from a browser if your bucket policy or ACLs allow s3:GetObject for the caller; otherwise you will see Access Denied.
Check that Block Public Access is not blocking the policy, the bucket policy statement uses the correct bucket ARN, and there is no explicit deny elsewhere. Also confirm you are using the object URL for the right Region and key.
AWS recommends bucket policies and IAM with ACLs disabled for new workloads. Policies centralise permissions on the bucket and are easier to audit than per-object ACLs.
S3 is flat object storage addressed by bucket plus key prefix. The console shows folders for convenience, but there are no classical directories; operations are API calls such as ListObjectsV2 and GetObject.

Next: copy objects locally

Use the AWS CLI to download one file, a whole prefix, or filtered file types from the same bucket.

S3 CLI download →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful