Create AWS CodePipeline

Create AWS CodePipeline

  1. Go to AWS CodePipeline

    • Select Pipeline
    • Select Create pipeline

CodePipeline

  1. In the interface to create CodePipeline

    • Enter aws-node-pipeline in Pipeline name
    • For Service role select New service role
    • Select Next

CodePipeline

  1. For Add source stage

    • Source provider, select AWS CodeCommit
    • Repository name, select aws-fcj-management
    • For Branch name, select master
    • Other items to default
    • Select Next

CodePipeline

  1. In the Build provider section, select AWS CodeBuild

CodePipeline

  1. For the Build stage part

    • Region, select Singapore
    • For Project name, select aws-fcj-management-build
    • Select Single build
    • Then select Next

CodePipeline

  1. For Deploy stage

    • Select Amazon ECS (Blue/Green)
    • Select Next

CodePipeline

  1. Configure Deploy

    • For Deploy provider, select Amazon ECS (Blue/Green).
    • Region, select Singapore.
    • Select AWS CodeDeploy application name.
    • Select AWS CodeDeploy deployment group.
    • Configure Amazon ECS task definition.
    • Configure AWS CodeDeploy AppSpec file.
    • For Dynamically Update task definition image, select BuildArtifact and enter Placeholder text in the task definition with the same image name of the taskdef.json file.
    • Select Next.

CodePipeline

  1. Check again and select Create pipeline

CodePipeline

  1. Wait about 5 minutes we will see 2 stages Source and Build completed.

CodePipeline

  1. About 5+ minutes Stage Deploy no problem. We will click on Details to see details of the Deploy process.

CodePipeline

  1. In About 5 more minutes we will see the traffic gradually shifting from Original to Replacement.

CodePipeline

  1. About the next 5 minutes we will see Deployment lifecycle events complete all the steps.

CodePipeline

  1. It takes more than 1 hour to complete the deployment and traffic shift successfully.

CodePipeline

  1. We will test Amazon ECS Cluster
  • Select Task
  • Select the task with the same group as the configuration file taskdef.json and appspec.yaml

CodePipeline

  1. View detailed information of Task, then copy Public IP of the task to try access to the application via port 5000

CodePipeline

  1. Access the application successfully.

CodePipeline

  1. We recheck the completed Pipeline.

CodePipeline

  1. Observe stream log in CloudWatch

CodePipeline

  1. See event of the service.

CodePipeline

  1. View information Deployments

CodePipeline

  1. View information Metrics

CodePipeline

  1. View information Logs

CodePipeline