title: CodeDeploy step of CodePipeline because of insufficient role permissions
body: <p>I have a 3 stage <code>CodePipeline</code> on <code>AWS</code>.</p>
  
  <ol>
  <li><p>Source: Checks out upon commit a specific branch of <code>CodeCommit</code> (success)</p></li>
  <li><p>Build: Runs some tests on a docker image via <code>CodeBuild</code> (success)</p></li>
  <li><p>Deploy: Performs a deployment on a deployment group (a.k.a. some specifically tagged EC2 instances) via <code>CodeDeploy</code> (failure).</p></li>
  </ol>
  
  <p>Step 3 fails with </p>
  
  <blockquote>
    <p>Unable to access the artifact with Amazon S3 object key
    'someitem-/BuildArtif/5zyjxoZ' located in the Amazon S3
    artifact bucket 'codepipeline-eu-west-1-somerandomnumber'. The provided
    role does not have sufficient permissions.</p>
  </blockquote>
  
  <p>Which role is the later referring to?</p>
  
  <p>The service role of <code>CodePipeline</code> or the service role of <code>CodeDeploy</code>?</p>
  
  <p>I am almost certain I have attached the appropriate policies to both though ...</p>
  
  <p>Here is a snippet of my <code>CodePipeline</code> service role </p>
  
  <p><a href="https://i.stack.imgur.com/4CRjU.png" rel="noreferrer"><img src="https://i.stack.imgur.com/4CRjU.png" alt="enter image description here"></a></p>