Step-by-Step Complete Walkthrough

1. Prerequisites

Before you start, make sure you have the following ready:

  1. AWS Account: Ensure you have access to AWS services, including S3, CloudFront, and IAM.
  2. GitHub Repository: Your web app codebase should be in a GitHub repository.
  3. AWS CLI Installed (Optional): You can install it locally for manual testing.

2. Setting Up AWS S3 Bucket for Static Web Hosting

  1. Create an S3 Bucket:

  2. Configure Bucket Policy:

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Principal": "*",
          "Action": "s3:GetObject",
          "Resource": "arn:aws:s3:::YOUR_BUCKET_NAME/*"
        }
      ]
    }
    
  3. Enable Static Website Hosting:


3. Setting Up CloudFront for Content Delivery

  1. Create a CloudFront Distribution:

4. Configuring AWS IAM User for CI/CD Access

  1. Create an IAM User:
  2. Attach Policies:
  3. Save the Access Keys: