# S3 URL format https://<bucket-name>.s3.<region>.amazonaws.com/<key> # Example https://my-school-2024.s3.ap-southeast-1.amazonaws.com/photos/photo1.jpg
1. Bucket → Properties → Static website hosting → Enable
2. Index document: index.html
3. Error document: error.html
4. Permissions → Block public access → OFF (for public website)
5. Bucket policy → JSON ထည့်:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my-bucket-name/*"
}
]
}
Website URL: http://<bucket>.s3-website.<region>.amazonaws.com
# AWS CLI install pip install awscli aws configure # Access key, Secret key, Region ထည့် # Files upload aws s3 cp index.html s3://my-bucket/ aws s3 cp ./dist/ s3://my-bucket/ --recursive # List files aws s3 ls s3://my-bucket/ # Delete file aws s3 rm s3://my-bucket/old-file.jpg # Sync folder (deploy) aws s3 sync ./dist/ s3://my-bucket/ --delete
CloudFront = Global CDN — S3 files ကို ကမ္ဘာတဝှမ်း fast deliver Setup: 1. CloudFront → Create Distribution 2. Origin domain: S3 bucket ရွေး 3. Default root object: index.html 4. Create distribution (15 min ကြာ) 5. HTTPS URL ရမယ်: https://xxx.cloudfront.net Benefits: ✅ HTTPS free (ACM certificate) ✅ Global edge servers → faster loading ✅ DDoS protection built-in ✅ Custom domain: mysite.com → CloudFront
| Class | ဘာအတွက် | Cost |
|---|---|---|
| Standard | Frequently accessed data | ကြီး |
| Standard-IA | Infrequent access | သက်သာ |
| Glacier | Archive (retrieve: hours) | အသက်သာဆုံး |
| Glacier Instant | Archive (retrieve: ms) | သက်သာ |
← AWS 02 | Next: AWS 04 → RDS →