Search code examples
amazon-web-servicesdevopsamazon-ecsaws-code-deployblue-green-deployment

How to provide AppSpec and Task Definition to CodeDeploy in ECR sourced pipeline


I want to trigger a blue/green ECS deploy on ECR image update. The deployment stage requires three input artifacts: imageDetail.json, appspec.json and taskdef.json.

While creating a pipeline I pick ECR repository as a source, which creates an imageDetail.json SourceArtifact, this is clear. Later in a build stage I can put it in output artifacts.

What I miss completely is how to provide the two remaining files? Should I inline them in the build stage definition buildspec.yaml (they are quite big and inlining seems tedious) or fetch them somehow from CodeCommit (so far I thought I can do it without having to set up CodeCommit only for that purpose)?

What is the usual practice for providing those files?


Solution

  • Yes, you will need to source the other files from a Code repository (github/CodeCommit). This tutorial is a nice guide on the ECS/CodeDeploy deployment pipeline:

    https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-ecs-ecr-codedeploy.html