Skip to content

AWS S3 — Simple Storage Service

Amazon S3 is AWS’s object storage service — scalable, highly durable, and globally accessible. It stores any kind of data (files, images, videos, backups, logs, static websites) as objects inside buckets.

In Azure terms: AWS S3 = Azure Blob Storage

TermDescription
BucketTop-level container for objects (like a folder at the root level)
ObjectA file and its metadata stored in a bucket
KeyThe full path/name of an object within a bucket (e.g., images/photo.jpg)
RegionEach bucket is created in a specific AWS region
PrefixA string used to simulate folder hierarchies (e.g., logs/2024/)
  • Must be globally unique across all AWS accounts
  • 3–63 characters long
  • Lowercase letters, numbers, and hyphens only
  • Cannot be formatted as an IP address
ClassUse CaseDurabilityRetrieval
S3 StandardFrequently accessed data99.999999999% (11 nines)Instant
S3 Intelligent-TieringUnknown or changing access patterns11 ninesInstant
S3 Standard-IAInfrequently accessed, needs fast retrieval11 ninesInstant (retrieval fee)
S3 One Zone-IAInfrequent access, single AZ (lower cost)11 nines (single AZ)Instant (retrieval fee)
S3 Glacier InstantArchive with immediate retrieval11 ninesInstant
S3 Glacier FlexibleArchive, retrieval in minutes to hours11 ninesMinutes to hours
S3 Glacier Deep ArchiveLowest cost archive, retrieval in hours11 nines12–48 hours

In Azure terms: Standard ≈ Hot, Standard-IA ≈ Cool, Glacier ≈ Archive.

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my-public-bucket/*"
}
]
}
MechanismDescription
Bucket PolicyJSON policy attached to the bucket — controls who can access what
IAM PolicyControls what an IAM identity can do with S3
Block Public AccessAccount or bucket-level toggle to prevent public access (enabled by default)
ACLsLegacy per-object access control — avoid in new architectures
Presigned URLsTemporary signed URLs for sharing private objects
Server-Side EncryptionSSE-S3 (AES-256), SSE-KMS (customer-managed keys), SSE-C (customer keys)

Enable versioning to keep multiple versions of an object:

Terminal window
aws s3api put-bucket-versioning \
--bucket my-bucket \
--versioning-configuration Status=Enabled
  • Protects against accidental deletion
  • Each overwrite creates a new version with a unique ID
  • Old versions billed at standard storage rates

Automate transitions between storage classes or deletion:

{
"Rules": [{
"Status": "Enabled",
"Transitions": [
{ "Days": 30, "StorageClass": "STANDARD_IA" },
{ "Days": 90, "StorageClass": "GLACIER" }
],
"Expiration": { "Days": 365 }
}]
}

S3 can host static websites (HTML, CSS, JS):

Terminal window
aws s3 website s3://my-bucket/ \
--index-document index.html \
--error-document error.html

In Azure terms: this is equivalent to Azure Storage static website hosting.

Trigger Lambda, SQS, or SNS when objects are created, deleted, or replicated.

FeatureAWS S3Azure Blob Storage
Container nameBucketContainer
Object pathKeyBlob name
Storage tiersStandard, IA, GlacierHot, Cool, Cold, Archive
Static websiteBuilt-inBuilt-in
VersioningOptionalOptional
Global uniquenessBucket name (global)Storage account name (global)
Encryption at restSSE-S3 / SSE-KMSSSE with Microsoft/Customer managed keys
SDK integrationboto3 (Python), aws-sdk (JS)azure-storage-blob
Terminal window
# Create a bucket
aws s3 mb s3://my-unique-bucket-name --region us-east-1
# Upload a file
aws s3 cp ./file.txt s3://my-bucket/file.txt
# Sync a local folder to S3
aws s3 sync ./local-folder s3://my-bucket/folder/
# List objects in a bucket
aws s3 ls s3://my-bucket/ --recursive
# Download a file
aws s3 cp s3://my-bucket/file.txt ./file.txt
# Delete an object
aws s3 rm s3://my-bucket/file.txt
# Set bucket to block all public access
aws s3api put-public-access-block \
--bucket my-bucket \
--public-access-block-configuration \
"BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true"