SkillSprout
Chapter 6 · Lesson 2
Intermediate
6 min read

S3 Operations and Data Management

Overview

Amazon S3 is object storage with effectively unlimited capacity. Day-to-day operations revolve around protecting data (versioning, replication, Object Lock), optimising cost (storage classes, lifecycle policies), securing access (Block Public Access, bucket policies) and observing usage (Storage Lens, inventory, metrics).

Think of S3 as a warehouse with automatic shelving. You decide which shelf class suits each box (hot, cool, deep freeze), set rules that move boxes over time, install security cameras (logging), and keep carbon copies (replication) in another warehouse.

SysOps scenarios commonly involve accidental deletion, cost drift, cross-account access and 403 errors.

Key Concepts

  • Storage classes: Standard, Intelligent-Tiering, Standard-IA, One Zone-IA, Glacier Instant Retrieval, Glacier Flexible Retrieval, Glacier Deep Archive, plus S3 Express One Zone.
  • Versioning protects against overwrite/delete (delete adds a delete marker); MFA Delete adds protection for permanent deletes; once enabled, versioning can only be suspended.
  • Lifecycle rules transition objects between classes and expire current/non-current versions, incomplete multipart uploads and delete markers.
  • Replication (CRR/SRR) needs versioning on both buckets, an IAM role, and replicates new objects only (use Batch Replication for existing); replicate delete markers optionally.
  • Object Lock (governance / compliance mode, legal hold) gives WORM retention and requires versioning.
  • Block Public Access, bucket policies, ACL disabling (Bucket owner enforced) and Access Points manage security at scale.
  • Monitoring: CloudWatch request/storage metrics, Storage Lens dashboards, S3 Inventory, server access logs (best effort) and CloudTrail data events (precise).
  • Event notifications to SNS/SQS/Lambda/EventBridge; Batch Operations run actions across billions of objects; request rates scale to 3,500 PUT / 5,500 GET per second per prefix.

Detailed Notes

Storage class choice

ClassAccess patternMin durationRetrieval
StandardFrequentnonems
Intelligent-TieringUnknown/changingnone (30-day monitoring)ms (archive tiers optional)
Standard-IAInfrequent, multi-AZ30 daysms, per-GB fee
One Zone-IARe-creatable, infrequent30 daysms
Glacier InstantArchive, instant90 daysms
Glacier FlexibleArchive90 daysminutes-12 h
Deep ArchiveLong-term180 days12-48 h

Lifecycle policy

json
{
  "Rules": [{
    "ID": "logs-tiering",
    "Status": "Enabled",
    "Filter": { "Prefix": "logs/" },
    "Transitions": [
      { "Days": 30, "StorageClass": "STANDARD_IA" },
      { "Days": 90, "StorageClass": "GLACIER" }
    ],
    "Expiration": { "Days": 730 },
    "NoncurrentVersionExpiration": { "NoncurrentDays": 30 },
    "AbortIncompleteMultipartUpload": { "DaysAfterInitiation": 7 }
  }]
}
bash
aws s3api put-bucket-lifecycle-configuration --bucket my-bucket --lifecycle-configuration file://lc.json
aws s3api put-bucket-versioning --bucket my-bucket --versioning-configuration Status=Enabled
aws s3api list-object-versions --bucket my-bucket --prefix report.csv

Recovering a deleted object

With versioning, a normal DELETE adds a delete marker. Remove the marker (delete that specific version ID) to restore the object:

bash
aws s3api delete-object --bucket my-bucket --key report.csv --version-id <DELETE_MARKER_VERSION_ID>

Replication

bash
aws s3api put-bucket-replication --bucket src-bucket --replication-configuration '{
  "Role":"arn:aws:iam::111122223333:role/s3-replication",
  "Rules":[{"ID":"all","Status":"Enabled","Priority":1,"Filter":{},
  "DeleteMarkerReplication":{"Status":"Enabled"},
  "Destination":{"Bucket":"arn:aws:s3:::dest-bucket","StorageClass":"STANDARD_IA"}}]}'

Use Replication Time Control (RTC) for 15-minute SLA. Objects encrypted with SSE-KMS need KMS permissions on source and destination keys.

Securing buckets

bash
aws s3api put-public-access-block --bucket my-bucket --public-access-block-configuration \
  BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true

Enforce TLS and encryption with a bucket policy condition aws:SecureTransport = false -> Deny. SSE-S3 is applied to all new objects by default.

Troubleshooting S3

SymptomCause
403 AccessDeniedIAM/bucket policy, Block Public Access, KMS key access, object owned by another account, VPC endpoint policy
404 on existing keyWrong Region/prefix, key case sensitivity, eventual propagation of delete marker
503 Slow DownRequest rate to a prefix too high -> spread prefixes, retry with exponential backoff
Replication not happeningVersioning disabled, role permissions, object existed before rule, SSE-KMS permissions
Unexpected costsOld versions, incomplete multipart uploads, request/transfer charges, Intelligent-Tiering monitoring fees on tiny objects
Slow large uploadsUse multipart upload, Transfer Acceleration, parallel threads

Insight tools

ToolValue
Storage LensOrganisation-wide usage and activity dashboards, recommendations
S3 InventoryScheduled object list (CSV/Parquet) with encryption/replication status
Storage class analysisRecommends IA transition thresholds
CloudTrail data eventsWho accessed which object
FeatureOperational notes
Lifecycle rulesTransition between classes and expire objects/noncurrent versions; minimum storage durations apply (for example 30 days for Standard-IA)
Intelligent-TieringAuto-moves objects by access pattern; small monitoring fee per object
CRR / SRRNeeds versioning on both buckets; replicates new objects only (use Batch Replication for existing); delete markers optional
S3 Object LockWORM retention, governance or compliance mode
Event notificationsTo SNS, SQS, Lambda or EventBridge
S3 Inventory / Storage LensVisibility and cost analytics
Multipart uploadAbort incomplete uploads with a lifecycle rule
bash
aws s3api put-bucket-lifecycle-configuration --bucket logs-prod --lifecycle-configuration file://lifecycle.json
aws s3api get-bucket-replication --bucket logs-prod
aws s3api put-public-access-block --bucket logs-prod --public-access-block-configuration BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true

For AccessDenied check in order: IAM policy, bucket policy, Block Public Access, SCP, VPC endpoint policy, KMS key permissions for SSE-KMS objects, and object ownership (disable ACLs with bucket owner enforced). 503 SlowDown means high request rates on a prefix: spread keys and add retries with backoff. Pre-signed URLs expire with the signer's credentials, so role-based URLs end when the session does.

Real World Example

Scenario – accidental deletion and creeping cost. An analyst's script deleted a prefix of customer reports. Because the bucket had versioning, the ops team listed versions and removed the delete markers to restore everything in minutes. They then enabled MFA Delete for the compliance bucket and a replication rule to a second Region.

Storage Lens revealed 40 TB of non-current versions and incomplete multipart uploads. A lifecycle rule now expires non-current versions after 30 days and aborts incomplete uploads after 7, cutting the bill by 30%.

Architecture Diagram

S3 data protection and tiering
Architecture
AWS Cloud
Applications
Source bucketversioning + Block Public Access
DR bucketother Region
Glacierarchive
  1. 1Applications write objects; versioning keeps every version.
  2. 2Replication copies new objects to a bucket in another Region.
  3. 3Lifecycle rules transition older objects to cheaper classes and eventually expire them.
  4. 4Storage Lens and inventory report usage so rules can be tuned.

Best Practices

  • ✓Enable versioning (plus MFA Delete or Object Lock where required) and Block Public Access account-wide.
  • ✓Add lifecycle rules for non-current versions, delete markers and incomplete multipart uploads.
  • ✓Use Intelligent-Tiering when access patterns are unknown.
  • ✓Replicate critical data cross-Region and monitor replication metrics.
  • ✓Enable Storage Lens, inventory and CloudTrail data events for sensitive buckets.

Common Interview Questions

Exam Tips

SOA-C03 focus

  • Protect against accidental deletion -> versioning (+ MFA Delete); WORM compliance -> Object Lock.
  • Move data between classes automatically -> lifecycle; unknown access -> Intelligent-Tiering.
  • Replication requires versioning in both buckets and affects only new objects.
  • Accessing S3 privately from a VPC -> gateway endpoint; auditing object access -> CloudTrail data events.

Finished this lesson?

0 of 46 lessons done · 0% of the course