INFRASTRUCTURE LEARNINGINFRASTRUCTURE LEARNING
インフラ大全インフラ大全IT INFRASTRUCTURE / LEARNING
Infrastructure learning guide
Find a lesson or lab/

Esc to close · Search terms stay on your device

LEARNING日本語

Core lesson 11 of 18Topic: S3: storage and access

What is Amazon S3? Buckets, keys and objects for beginners

Amazon Simple Storage Service (S3) stores data as objects. Start by separating a bucket, the container, a key, the object’s identifier, and the object, the stored data and its metadata. A monthly report example connects these terms to storage operations and access permissions.

What you will learn

Identify a stored object by bucket and key, and distinguish storing data, retrieving data and changing access policy.

Prerequisite

No account is needed. Imagine an app saving and opening a file. This lesson covers the basics of general purpose buckets.

How do buckets, keys and objects differ?

A bucket contains objects. An object combines data, such as a file, with metadata describing it. A key identifies the object inside its bucket. For a bucket named demo-reports and a key reports/monthly.pdf, both values identify the data you want to request.

Two objects inside one bucket
Two objects inside one bucket1: demo-reports — Use this key to identify the monthly report — reports/monthly.pdf. 2: demo-reports — A different key identifies a different object — reports/annual.pdf12demo-reportsreports/monthly.pdfreports/annual.pdfTwo objects inside one bucket1: demo-reports — Use this key to identify the monthly report — reports/monthly.pdf. 2: demo-reports — A different key identifies a different object — reports/annual.pdf12demo-reportsreports/monthly.pdfreports/annual.pdf
  1. demo-reports → reports/monthly.pdfUse this key to identify the monthly report
  2. demo-reports → reports/annual.pdfA different key identifies a different object
demo-reports
A general purpose bucket containing objects identified by keys.
reports/monthly.pdf
The complete key for the monthly report includes its prefix.
reports/annual.pdf
A different key in the same bucket identifies another object.
Read the terms in the report example
TermExampleMeaning
Bucketdemo-reportsThe container
Keyreports/monthly.pdfThe complete identifier inside that bucket
ObjectReport data and metadataThe stored item being retrieved or written

A folder-like prefix is part of the key

A key in a general purpose bucket is not a local filesystem path. A prefix, such as reports/, and a delimiter let tools display a folder-like view. A GetObject request uses the full key reports/monthly.pdf.

monthly.pdf and reports/monthly.pdf are different keys. Keys are also case-sensitive. Compare the actual key used for the write and the read instead of relying on a similar-looking name or folder display.

Separate writing data, reading data and changing policy

Be precise about what is being saved
TaskExample operationTarget
Store report dataPutObjectAn object in the bucket
Read the reportGetObjectAn object in the bucket
Change access rulesPutBucketPolicyThe bucket policy

Storing an object does not make it a publicly readable file. Retrieval depends on the requester’s permissions, relevant bucket policy and public-access controls. A successful write does not establish that another principal may read the object.

Trace one report read

  1. Identify the bucket: demo-reports in this example.
  2. Identify the complete key: reports/monthly.pdf.
  3. Review the requester’s GetObject permissions and any relevant encryption conditions.
  4. Compare the result with the requested target. A denial alone does not prove that the object is absent.

Choose an option to see the result and explanation.

In the same bucket, do monthly.pdf and reports/monthly.pdf identify the same object?
Read the answer and reason

Answer: Different keys identify different objects · The prefix and delimiter are part of the key. GetObject needs the complete key used for that object.

Next, understand public-access controls

Continue to the four S3 Block Public Access settings. Then use the browser lab to compare writing a bucket policy with reading an existing object. You do not need to disable a real protection or upload real data.

Check, then explain in your own words

  1. Identify the location using bucket and complete key.
  2. Distinguish PutObject, GetObject and PutBucketPolicy.
  3. Explain why stored data is not automatically public.
Check your understanding: You stored report.csv. Does that mean an anonymous user can read it?

A successful write does not establish that.

Review the read requester, resource, permissions and restrictions separately. Identifying stored data and establishing access are different questions.

Sources and conditions checked

The official references used in this lesson are collected here with their scope, conditions and corresponding sections. Independent expert review and live AWS comparison have not been performed.