title: AWS CodePipeline with ECS Blue/Green deployment fails with internal error
body: <p>I have a CodePipeline set up where changes to code builds and pushes an image to ECR. I am looking to automate updating ECS with the new image as it is built. I have configured the ECS Blue/Green action but when it runs it fails almost immediately with a message about an "Internal Error". There is no failed deployment created in CodeDeploy.</p>
  
  <p>I have configured CodePipeline with two inputs:</p>
  
  <ol>
  <li>the source code used to build the image</li>
  <li>a zip in S3 containing the appspec.yaml and the taskdef.json</li>
  </ol>
  
  <p>When either input changes I rebuild the container and push to ECR tagged 'latest'. The next step should be a Blue/Green deployment to ECS. I have configured CodeDeploy and the job works if triggered manually.</p>
  
  <p>When it is triggered via CodePipeline it will fail and I receive a message "Action execution failed
  InternalError. Error reference code: &lt;some id&gt;". I suspect that there may be some underlying issue with IAM but I can't find where to start looking at this stage. There is no failed deployment shown in CodeDeploy so I don't see a way to get more information about what has failed.</p>
  
  <p>My policy for CodePipeline is copied from the one documented here: <a href="https://docs.aws.amazon.com/codepipeline/latest/userguide/how-to-custom-role.html#view-default-service-role-policy" rel="nofollow noreferrer">https://docs.aws.amazon.com/codepipeline/latest/userguide/how-to-custom-role.html#view-default-service-role-policy</a></p>
  
  <p>I have read through the troubleshooting docs here: <a href="https://docs.aws.amazon.com/codepipeline/latest/userguide/troubleshooting.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/codepipeline/latest/userguide/troubleshooting.html</a></p>
  
  <p>I believe my issue is similar to the one described here: <a href="https://forums.aws.amazon.com/thread.jspa?messageID=897822" rel="nofollow noreferrer">https://forums.aws.amazon.com/thread.jspa?messageID=897822</a></p>