How to use Amazon S3 for object storage
· Category: Cloud Computing
Short answer
Amazon S3 is object storage that stores data as objects within buckets, accessible via HTTP/HTTPS.
Steps
- Create a bucket via console or CLI:
aws s3 mb s3://my-unique-bucket-name
- Upload a file:
aws s3 cp file.txt s3://my-bucket/
- List contents:
aws s3 ls s3://my-bucket/
- Enable versioning and lifecycle rules in bucket settings.
Tips
- Bucket names are globally unique across all AWS accounts.
- Use S3 Intelligent-Tiering for unknown access patterns.
- Block public access unless you specifically need it.
Common issues
- Accidental public buckets: audit with S3 Block Public Access.
- Large numbers of small objects: consider archiving or using S3 Glacier.