Overview

This is a example of CI/CD environment implemented with:

And this also explains Three-Tier Architecture (official doc).

Prerequisites

  • Configure the backend of infrastructure/main.tf to your environment.
  • Setup Terraform Cloud.
  • Configure the on.push.branches of Github workflow to your main branch.
  • set environment for Github workflow for CodeDeploy.
  • Create custom ami to run Node.js app and PM2.

Expected Behaviour

Terraform

When you push main branch:

  • detect infrastructure changes.
  • Terraform Cloud make change remotely.

CodeDeploy

When you push main branch:

  • Create S3 object of app and deploy from Github workflow.
  • Run scripts/* following appspec.yml's directive to deploy.