Review the configurations

Open the CodeCommit repository

navigate-to-codecommit

CodeBuild uses the buildspec.yml for building the container 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.

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
    • REPOSITORY_URI:IMAGE_TAG
    • TASK_EXECUTION_ARN
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

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