Step 1: Create an S3 Bucket
- Open the AWS S3 Console.
- Click Create bucket.
- Name the bucket:
✅ Example:
demo-cloudfront-stephane-v4
- Keep default settings and click Create bucket.
Step 2: Upload Files to S3
- Open your newly created S3 bucket.
- Click Upload → Add files.
- Select three files:
index.html
coffee.jpeg
beach.jpeg
- Click Upload.
Access Check
- If you try to open
index.html via the Object URL, you’ll get an Access Denied error because the files are not public.
- You can generate a pre-signed URL to temporarily access the file.
Step 3: Set Up CloudFront Distribution
- Open the AWS CloudFront Console.
- Click Create Distribution.
- Under Origin Domain, select your S3 bucket.
- Choose Origin Access Control (OAC) (recommended method).