What You’ll Learn in This Tutorial
✓ S3 basic concepts
✓ Bucket creation and management
✓ Object upload and download
✓ Access control (IAM, bucket policies)
✓ Static website hosting
✓ Operations with AWS CLI/SDK
Prerequisites
- AWS account
- AWS CLI installed
Step 1: AWS CLI Setup
# Install AWS CLI (macOS)
brew install awscli
# Configure credentials
aws configure
# AWS Access Key ID: YOUR_ACCESS_KEY
# AWS Secret Access Key: YOUR_SECRET_KEY
# Default region name: ap-northeast-1
Step 2: Creating a Bucket
# Create bucket
aws s3 mb s3://my-tutorial-bucket-2024
# List buckets
aws s3 ls
Step 3: Object Operations
# Upload
aws s3 cp local-file.txt s3://my-tutorial-bucket-2024/
# Download
aws s3 cp s3://my-tutorial-bucket-2024/file.txt ./
# Sync
aws s3 sync ./local-folder s3://my-tutorial-bucket-2024/folder/
Step 4: Access Control
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my-bucket/public/*"
}
]
}
Step 5: Static Web Hosting
aws s3 website s3://my-website-bucket \
--index-document index.html \
--error-document error.html
Summary
AWS S3 is a scalable, highly durable object storage service.
← Back to list