Review the configurations

Open the CodeCommit repository

navigate-to-code-commit

CodeBuild uses the buildspec.yml for building the docker image and pushing to the Elastic Container Registry

  • Keep buildspec.yml in the root of the source code repository.
Expand to see buildspec.yml
  • The artifacts appspec.yaml and taskdef.json are used by the CodeDeploy.

  • For Amazon ECS compute platform applications, the AppSpec file is used by CodeDeploy to determine your Amazon ECS task definition file. TASK_DEFINITION placeholder will be replaced by the CodeDeploy automatically after registering the new taskdef.json. We will replace the TASK_FAMILY in the build stage.

Expand to see appspec.yaml
  • taskdef.json is the ECS task definition. New version is created by CodeDeploy for each deployment. We are replacing the below placeholders in the CodeBuild phase of the CodePipeline
    • AWS_REGION
    • TASK_FAMILY
    • REPOSITORY_URI:IMAGE_TAG
Expand to see taskdef.json
  • The placeholders for appspec.yaml and taskdef.json are being replaced in the buildspec.yml
  • The CodeBuild job has the required values available as ENVIRONMENT variables in the CDK stack
Expand to see CodeBuild config

We have completed the review for the Blue/Green deployment using CodeDeploy and ECS. Let’s cleanup the resources.