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

Esc to close · Search terms stay on your device

LEARNING日本語

Topic lessonTopic: S3 operations, storage choices and web delivery

S3 bucket basics: creation, upload, download and cleanup checks

S3 stores objects in buckets and retrieves them by key. Begin with one synthetic file in a non-public bucket and verify destination, permissions and downloaded content. Cleanup must account for retained versions, incomplete uploads and references, not just the current object listing.

What you will learn

Explain pre-creation checks, upload/download verification, retained data and the decision to delete or retain a bucket.

Prerequisite

A bucket contains objects; a key identifies an object within it. An API is an interface used by programs. These are synthetic teaching steps: no AWS connection, account or credentials are required.

Identify the target before creating anything

This lesson targets a general-purpose bucket, not directory buckets or every other S3 bucket type. Identify account, purpose, Region, namespace, owner and cost-review method first. A bucket name and Region cannot simply be changed after creation; moving data requires a migration decision.

Learning sequence: destination, content verification and cleanup
Learning sequence: destination, content verification and cleanup1: Pre-creation checks — Identify target — Upload synthetic data. 2: Upload synthetic data — Download and compare — Compare download. 3: Compare download — Decide retain or delete — Review retained data123Pre-creation checksUpload syntheticdataCompare downloadReview retaineddataLearning sequence: destination, content verification and cleanup1: Pre-creation checks — Identify target — Upload synthetic data. 2: Upload synthetic data — Download and compare — Compare download. 3: Compare download — Decide retain or delete — Review retained data123Pre-creationchecksUploadsynthetic dataComparedownloadReview retaineddata
  1. Pre-creation checks → Upload synthetic dataIdentify target
  2. Upload synthetic data → Compare downloadDownload and compare
  3. Compare download → Review retained dataDecide retain or delete
Pre-creation checks
Account, namespace, settings
Upload synthetic data
Bucket, key, content
Compare download
Compare with supplied content
Review retained data
Versions, parts, references

Check namespace and non-public settings

In the shared global namespace, a name must not collide with another account within the AWS partition. S3 also supports an account-regional namespace reserved for your account, with a format incorporating account ID, Region and an -an suffix. Check the chosen namespace rules rather than assuming an example name is available.

Avoid secrets, customer names and personal information in bucket names and object keys. Knowing a name does not establish access rights, and an obscure name does not replace authorization.

Pre-creation checks for a learning bucket
ItemCheckDistinction
TargetAuthorized account and general-purpose bucketDo not practise in a shared production bucket.
Object OwnershipNew-bucket default: Bucket owner enforced, ACLs disabledPolicies can control access without enabling ACLs.
Block Public AccessKeep all four settings for this non-public exerciseDo not disable public-access protection to fix each read error.
EncryptionInspect selected at-rest encryption, such as initial SSE-S3Encryption and authorization answer different questions.
VersioningB1 assumes disabled; inspect actual settings separatelyEnabling/suspending versioning does not remove historical versions.

B1: upload a synthetic file and compare the download

B1 assumes a new non-public general-purpose bucket, versioning disabled and an authorized principal. The key is learning/report.csv with the two supplied lines, and the case assumes no existing object is overwritten. The page explains the workflow without uploading anything or incurring resource charges.

Synthetic CSV for B1: compare original and downloaded content
month,total
2026-10,120
  1. Compare account, Region, namespace and selected settings before creation.
  2. Recheck the bucket and specify the synthetic file and intended key.
  3. Inspect the resulting key, size, storage class and relevant object information.
  4. Download through an authorized path and compare against the supplied two-line content.
  5. Record bucket, key, principal and observations so cleanup targets can be identified.

Listing an object, downloading it and matching its contents are separate checks. An authorized principal can retrieve from a non-public bucket; an anonymous public URL is unnecessary. Investigate operation, target, permissions and BPA when a request fails.

B2: what remains when the current listing is empty?

B2 is a separate versioning-enabled example. A key has v1 containing 6 MiB, then v2 containing 7 MiB, followed by a deletion without a version ID. A delete marker v3 is current while v1/v2 remain. A separate incomplete multipart upload retains 3 MiB of parts.

B2 retained data: current visibility versus stored content
ResourceSupplied sizeWhat to inspect
Noncurrent v16 MiBNot current, but its data remains.
Noncurrent v27 MiBA delete marker does not remove it.
Current delete marker v3Marker, not a data versionAn ordinary current read treats the object as deleted.
Incomplete upload parts3 MiBInspect separately from the object listing.

B2 retains 13 MiB in data versions; including supplied incomplete parts gives 16 MiB of payload. This is not a billed-size or price calculation including marker metadata. Inspect all versions, markers, unfinished uploads and any writers still adding data.

Separate emptying from deleting the bucket

Emptying deletes contents while retaining the bucket; it is not a reversible practice action. Bucket deletion depends on an empty state including removal of object versions and delete markers, and on conditions such as same-account access points. Investigate a refusal rather than removing protections indiscriminately.

Deleting a shared-global bucket can allow another account to reuse its name. Applications, DNS or log delivery still referencing it may target an unintended bucket. If retaining the name matters, consider emptying and restricting access while keeping the bucket. Distinguish this from account-regional namespace ownership.

  1. Identify ownership, deletion authority and data that must remain.
  2. Inspect application, logging and DNS references and ongoing writes.
  3. Inventory current/noncurrent versions, delete markers and incomplete parts separately.
  4. Decide whether to retain the empty bucket or delete it with name-reuse implications.
  5. After an authorized action, recheck retained data, references and cost-bearing resources.

Check upload, access and cleanup decisions

Choose an option to see the result and explanation.

B1 needs its synthetic CSV downloaded. Should BPA be disabled because anonymous access fails?
Read the answer and reason

Answer: No; check the principal, target and permissions. · B1 has no anonymous-public-access requirement.

B2 has v1=6 MiB, v2=7 MiB and incomplete parts=3 MiB. What is the supplied payload total?
Read the answer and reason

Answer: 16 MiB: 13 in versions plus 3 in parts. · This checks supplied payload, not the invoice.

An app still references an old shared-global bucket name. What must be checked before deletion?
Read the answer and reason

Answer: References and consequences of name reuse. · Account for possible name reuse by another account.

Only B2’s current listing is empty. Is bucket-deletion readiness established?
Read the answer and reason

Answer: No; check versions, parts, references and other conditions. · Separate current visibility from deletion readiness.

Check, then explain in your own words

  1. Identify target and initial settings.
  2. Check the synthetic CSV key and content.
  3. Compare downloaded content with the original.
  4. Check B2 retained payload and cleanup conditions.
Check your understanding: B1 downloads a CSV with different rows. Can an upload-completed message alone close verification?

No. Match bucket, key, downloaded version and supplied original content, and check whether another object was retrieved. Permission checks alone do not establish content equality.

Verify operation completion, target identity and retrieved results separately.

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.