Skip to content
Infrastructure code for static website with S3 and CloudFormation
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Infrastructure code for static website with S3 and Cloudfront

This repository contains CloudFormation infrastructure code for creating static websites using S3 and Cloudfront. It :

  1. Creates a CodeCommit repository to hold code for the static website.
  2. Creates a CodeBuild project to continuously deploy on git push.
  3. Creates the S3 bucket and Cloudfront distribution to host and front the website.
  4. Creates the Route53 A and CNAME records for the domain of the website.

You will need:

  1. A Route53 hosted zone for your domain.
  2. To create a buildspec.yml that tells CodeBuild how to build and deploys your static website contents to the S3 bucket. Could be something as simple as this:
version: 0.2

      - gem install bundler jekyll
      - gem install jekyll-last-modified-at
      - gem install minima
      - jekyll build
      - aws s3 sync _site/ s3://
      - aws cloudfront create-invalidation --distribution-id E1PRO30G7BA7NW --paths "/*"
  1. Some time and patience :).
You can’t perform that action at this time.