{"id":8706,"date":"2019-01-27T20:37:38","date_gmt":"2019-01-28T01:37:38","guid":{"rendered":"https:\/\/www.carnaghan.com\/?p=8706"},"modified":"2019-07-28T15:59:18","modified_gmt":"2019-07-28T20:59:18","slug":"aws-codepipeline-for-static-websites","status":"publish","type":"post","link":"https:\/\/www.carnaghan.com\/aws-codepipeline-for-static-websites\/","title":{"rendered":"AWS CodePipeline for Static Websites"},"content":{"rendered":"

AWS offers an immense array of features for deploying and managing complex sites. There are however a lot of use cases where you want to quickly setup an easy to use pipeline for deploying static websites (without a build process). I am going to cover how to get started using AWS to setup a basic no-frills web server using an easy-to-use deployment setup via AWS code repository and deployment services.<\/p>\n

\"\"<\/a><\/p>\n

Before we get started, there are a couple of pre-requisites needed in order to follow along:<\/p>\n

    \n
  1. AWS account with EC2,  S3, CodePipeline, CodeDeploy, and CodeCommit permissions. If you don’t have an AWS account, you can sign up for the free tier for one year.<\/li>\n
  2. Git client: For Mac, I recommend Homebrew<\/a> (brew install git). On the PC, you can use Git SCM<\/a>.<\/li>\n<\/ol>\n

    There are a number of steps we need to complete in order to setup our code pipeline with a new web server. These steps include creating a new security group, setting up a key pair, which we will use to access our AWS EC2 instance, provisioning a new EC2 instance, and setting up our code pipeline for Continuous Integration\/Continuous Delivery (CI\/CD).<\/p>\n

    Roles and Permissions<\/h2>\n

    When setting up a CodeDeploy (later in this article), we will need to use service roles for to provide needed permissions for both the CodeDeploy service (service role) as well as for our EC2 instance that we are deploying code to (instance role). Let’s go ahead and set these up. There are more detailed directions available within AWS documentation and I’ve provided links should you want to learn more.<\/p>\n

    CodeDeploy Service Role<\/h3>\n