S3 Storage Classes

Storage classes let you trade retrieval speed for lower cost, from instant Standard to cheap archival Glacier.

Not all data needs the same speed. S3 storage classes let you match cost to access pattern.

ClassBest forRetrieval
S3 StandardFrequently accessed dataInstant
S3 Standard-IAInfrequent accessInstant (per-GB fee)
S3 One Zone-IARe-creatable, one AZInstant, cheaper
S3 Glacier InstantArchives, rare accessInstant
S3 Glacier Deep ArchiveLong-term cold storageHours

Intelligent-Tiering

S3 Intelligent-Tiering moves objects between tiers automatically based on how often they are accessed, so you save money without managing it by hand.

Lifecycle rules

Attach a lifecycle policy to a bucket to transition objects to cheaper classes or delete them after a set number of days.

Example

Example · bash
# Upload an object directly into a cheaper storage class
aws s3 cp backup.tar.gz s3://my-app-backups/backup.tar.gz \
  --storage-class STANDARD_IA

# Apply a lifecycle rule (rules defined in lifecycle.json)
aws s3api put-bucket-lifecycle-configuration \
  --bucket my-app-backups \
  --lifecycle-configuration file://lifecycle.json

When to use it

  • An application stores frequently accessed user data in S3 Standard but automatically transitions 90-day-old logs to S3 Glacier Instant Retrieval to cut costs.
  • A legal firm archives case documents to S3 Glacier Deep Archive at $0.00099/GB/month, accepting 12-hour retrieval times for rarely needed files.
  • A media company uses S3 Intelligent-Tiering for video assets of unknown access patterns, letting AWS move them between tiers automatically.

More examples

Upload Object with Storage Class

Uploads a file directly to S3 Standard-IA, suitable for data accessed less than once a month with lower storage cost.

Example · bash
aws s3 cp archive.zip s3://my-bucket/archives/archive.zip \
  --storage-class STANDARD_IA

Create a Lifecycle Rule for Tiering

Configures a lifecycle rule that automatically moves objects under the logs/ prefix to Glacier after 90 days.

Example · bash
aws s3api put-bucket-lifecycle-configuration \
  --bucket my-bucket \
  --lifecycle-configuration '{
    "Rules": [{
      "ID": "MoveToGlacier",
      "Status": "Enabled",
      "Filter": {"Prefix": "logs/"},
      "Transitions": [{
        "Days": 90,
        "StorageClass": "GLACIER"
      }]
    }]
  }'

Check Object's Current Storage Class

Retrieves metadata for a single S3 object, including its current storage class, to verify tiering took effect.

Example · bash
aws s3api head-object \
  --bucket my-bucket \
  --key archives/archive.zip \
  --query '{StorageClass:StorageClass,Size:ContentLength,Modified:LastModified}' \
  --output table

Discussion

  • Be the first to comment on this lesson.