
Cloud
Learning Level
Amazon S3 is perfect for hosting static websites with high availability and global distribution.
By the end of this lesson, you'll understand:
# Create bucket
aws s3 mb s3://my-website-bucket
# Enable static website hosting
aws s3 website s3://my-website-bucket \
--index-document index.html \
--error-document error.html# Upload single file
aws s3 cp index.html s3://my-website-bucket/
# Upload directory recursively
aws s3 sync ./public s3://my-website-bucket/
# Upload with public access
aws s3 sync ./public s3://my-website-bucket/ --acl public-read# Create policy
cat > policy.json << 'EOF'
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicRead",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my-website-bucket/*"
}
]
}
EOF
# Apply policy
aws s3api put-bucket-policy \
--bucket my-website-bucket \
--policy file://policy.json# Create distribution
aws cloudfront create-distribution \
--distribution-config file://distribution.json
# View distribution URL
aws cloudfront list-distributions \
--query 'DistributionList.Items[0].DomainName'Learn about RDS for databases, or explore Lambda integration.
Resources
Ojasa Mirai
Master AI-powered development skills through structured learning, real projects, and verified credentials. Whether you're upskilling your team or launching your career, we deliver the skills companies actually need.
Learn Deep • Build Real • Verify Skills • Launch Forward