My CodePipeline currently has a Github Source and a CodeBuild that builds an image and pushes it to ECR:
+---------------+ +-----------+ +-----+
| GitHub Source +----->+ CodeBuild +---->+ ECR |
+---------------+ +-----------+ +-----+
I want to add a CodeDeploy step to the pipeline which will take the image pushed to ECR and deploy it on ECS. But my CodeBuild step does not produce any artifacts (It uploads to ECS, and I don't know how to define a ECR image as an artifact). So I am not able to connect the CodeDeploy to the pipeline. Any idea how to do this?
+---------------+ +-----------+ +-----+ +------------+ +-----+
| GitHub Source +----->+ CodeBuild +---->+ ECR +----->+ CodeDeploy +---->+ ECS |
+---------------+ +-----------+ +-----+ +------------+ +-----+
The only solution I can think of is to make a second pipeline that will take ECR as a source, and do the deployment.
Pipeline 1
+---------------+ +-----------+ +-----+
| GitHub Source +----->+ CodeBuild +---->+ ECR |
+---------------+ +-----------+ +-----+
Pipeline 2
+-----+ +------------+ +-----+
| ECR +----->+ CodeDeploy +---->+ ECS |
+-----+ +------------+ +-----+