Ojasa Mirai

Ojasa Mirai

Cloud

Loading...

Learning Level

🟢 Beginner🔵 Advanced
🔧 AWS Account Setup⚙️ AWS Compute Overview🖥️ EC2 Deployment🎯 Elastic Beanstalk⚡ Lambda Serverless📁 S3 Static Hosting🗄️ RDS Relational Database📊 DynamoDB NoSQL💾 ElastiCache Caching📊 AWS Monitoring🔑 AWS Authentication📈 AWS Scaling & Load Balancing🐳 AWS ECS Containers💰 AWS Cost Optimization
Cloud/Aws Deployment/S3 Static Hosting

📁 S3 Static Hosting

Introduction

Amazon S3 is perfect for hosting static websites with high availability and global distribution.

Key Learning Outcomes

By the end of this lesson, you'll understand:

  • Creating S3 buckets
  • Uploading static content
  • Configuring website hosting
  • Setting permissions
  • Using CloudFront CDN
  • Custom domains

Creating a Bucket

# 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

Uploading Content

# 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

Bucket Policy

# 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

CloudFront Distribution

# Create distribution
aws cloudfront create-distribution \
  --distribution-config file://distribution.json

# View distribution URL
aws cloudfront list-distributions \
  --query 'DistributionList.Items[0].DomainName'

Key Takeaways

  • **S3** stores static website content
  • **Buckets** organize objects
  • **Policies** control access
  • **CloudFront** delivers content globally
  • **Highly available** and cost-effective

Next Steps

Learn about RDS for databases, or explore Lambda integration.


Resources

Python Docs

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

Courses

PythonFastapiReactJSCloud

© 2026 Ojasa Mirai. All rights reserved.

TwitterGitHubLinkedIn