I wanted to create a CodePipeline which builds a container image from CodeCommit source and afterwards deploys the new image in Blue/Green fashion to my ECS service (EC2 launchtype).
- The source stage is CodeCommit, which already includes appspec.json
as well as taskdef.json - The build stage is building the new container & pushing it to ECR successfully, the file imagedefinition.json is the BuildArtifact created at this step, containing the container and the recently created image with its tag corresponding to the CodeCommit commit-id.
- The deploy stage is made of action "Amazon ECS (Blue/Green)" using the SourceArtifact and BuildArtifact as InputArtifacts, to take the appspec and taskdef from the SourceArtifact and the image description from the BuildArtifact, to finally deploy the new container in Blue/Green manner.
The problem is with the image definition from the BuildArtifact. The pipeline fails in the Deploy phase with error:
"" Invalid action configuration Exception while trying to read the image artifact file from the artifact: BuildArtifact. ""
How to properly configure the "Amazon ECS (Blue/Green)" deploy phase, so that it can use the recently created image and deploy it....by replacing placeholder IMAGE_NAME inside taskdef.json ?
Any hint highly appreciated :D