/static-website

A simple static website

Primary LanguageHTML

static-website

A simple static website to explore how an AWS CodePipeline can be used to automatically deploy updates when commits are made to a GitHub repo. The intent was to produce a generic piece of infrastructure code that could be added to a static website repo without a lot of effort.

To use this code, run infra/bootstrap.sh once and the pipeline should be configured and ready to go. It will perform the following steps:

  1. Launch the bootstrap.yml CloudFormation template:
    1. Create a KMS key with alias alias/${ProjectName}-${BranchName}-kmskey to encrypt the code artifacts stored in an S3 bucket
    2. Create S3 bucket ${ProjectName}-${BranchName}-code-artifact required by CodePipeline to store the code artifacts produced and consumed throughout the pipepline.
    3. Create an IAM role for the codepipeline to assume when running
    4. Create an IAM role for the webite pipeline to assume when deploying the artifacts to S3
    5. Create a CodePipeline to build the infrastructure needed:
      1. Source stage - pull the code from GitHub repo and store in the artifact S3 bucket
      2. Deploy-Bucket stage - use CloudFormation template bucket.yml to create the S3 static website bucket, configured to serve the HTML site
      3. Deploy-Pipeline stage - use CloudFormation template pipeline.yml to create the pipeline for updating website bucket with the latest code