Continuous Deployment of static application to AWS S3 using AWS CodePipeline
Before continuing, one should know the following things:
- Creating an S3 bucket
- Setting up CodeCommit (refer Chapter 1)
- Setting up CodeBuild (refer Chapter 2)
If you are comfortable in implementing the preceding, then you are good to go.
The workflow of the pipeline is as follows:
- The sample application code will reside in the CodeCommit repository
- Once there will be a change in the code, the CodeBuild will pull and upload the latest revision in S3
- The S3 bucket will be enabled to serve as website hosting
How to do it...
- Create a CodeCommit repository
CP-StaticApp
and put the source code file in the repository:

- Create an S3 bucket
cp-statapp
in the same region where you created the CodeCommit repository. We have to enableVersioning
andStatic website hosting
:

- The static website can be enabled by going to the
Properties
:

- Post that, we need to apply bucket policy by going to the
Permission
section of the bucket and click onbucket...