You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Buckets and objects are the two fundamental building blocks of Amazon S3. Mastering their behaviour, naming conventions, metadata handling, and upload strategies is critical to designing effective storage solutions.
S3 bucket names are subject to strict rules because they form part of the URL used to access objects:
| Rule | Detail |
|---|---|
| Globally unique | No two buckets across all AWS accounts can share a name |
| Length | 3 to 63 characters |
| Characters | Lowercase letters, numbers, and hyphens only |
| Start/end | Must start and end with a letter or number |
| No IP format | Cannot resemble an IP address (e.g. 192.168.1.1) |
| No periods | Avoid periods — they break HTTPS virtual-hosted-style URLs |
Good examples: my-app-assets, acme-corp-backups-2024, data-lake-raw
Bad examples: My_Bucket (uppercase and underscores), 192.168.5.4 (IP format), -start-with-hyphen
When you create a bucket, you can configure several important settings:
Buckets are created in a specific AWS Region. Choosing the right region affects:
Versioning keeps multiple variants of every object. We will cover this in depth in Lesson 4.
You can configure server-side encryption so that every object uploaded to the bucket is automatically encrypted. Options include SSE-S3, SSE-KMS, and DSSE-KMS.
Bucket tags are key-value pairs used for cost allocation and organisation:
aws s3api put-bucket-tagging --bucket my-app-assets --tagging 'TagSet=[{Key=Environment,Value=Production},{Key=Team,Value=Platform}]'
S3 has a flat namespace — there is no real directory hierarchy. However, you can use prefixes and delimiters to simulate folders.
Example keys:
logs/2024/01/access.log
logs/2024/01/error.log
images/thumbnail/photo1.jpg
images/original/photo1.jpg
Here, logs/2024/01/ is a prefix. The console displays these as folders, but technically they are just part of the object key.
aws s3 ls s3://my-app-assets/logs/2024/01/
This returns only objects whose keys start with logs/2024/01/.
Prefixes are important for:
Every S3 object carries metadata — key-value pairs that describe the object. There are two kinds:
Managed by S3 automatically:
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.