title: AWS Secrets Manager can’t find the specified secret
body: <p>I'm using AWS Fargate and storing sensitive data with Secrets Manager. Task definition should get environment variables from secrets store</p>
  
  <pre><code>- name: "app"
    image: "ecr-image:tag"
    essential: true
    secrets:
      - name: "VAR1"
        valueFrom: "arn:aws:secretsmanager:us-east-1:111222333444:secret:var-one-secret"
      - name: "VAR2"
        valueFrom: "arn:aws:secretsmanager:us-east-1:111222333444:secret:var-two-secret"
      - name: "VAR3"
        valueFrom: "arn:aws:secretsmanager:us-east-1:111222333444:secret:var-two-private"
  </code></pre>
  
  <p>but for some reason it fails with the error below</p>
  
  <pre><code>ResourceNotFoundException: Secrets Manager can’t find the specified secret. status code: 400, request id
  </code></pre>
  
  <p>It seems a bit strange to me because</p>
  
  <ul>
  <li><p>IAM has permissions for get secret value, moreover</p></li>
  <li><p>when leaving only <code>VAR1</code> variable everything works as expected</p></li>
  <li><p>AWS CLI is able to retrieve each secret without any issue</p></li>
  </ul>
  
  <p>e.g.</p>
  
  <pre><code>aws secretsmanager get-secret-value --secret-id var-two-secret
  </code></pre>
  
  <p>What might be wrong with my configuration? Any hints appreciated</p>