title: AWS lambda not able to access cross account s3 bucket object but from cli its working
body: <p>I am getting forbidden error while accessing cross-account s3 buckets, but I am able to access bucket using aws s3 cli.</p>
  <p>I have checked the following things:</p>
  <ol>
  <li>I have tested code in June and was working and not changed in the last 4 months.</li>
  <li>Lambda role (not changed in the last 4 months):</li>
  </ol>
  <pre><code>        {
              &quot;Action&quot;: &quot;s3:*&quot;,
              &quot;Resource&quot;: [
                  &quot;*&quot;
              ],
              &quot;Effect&quot;: &quot;Allow&quot;
          },
  </code></pre>
  <ol start="3">
  <li>code is working with s3 bucket in the same account.</li>
  <li>in account 2 all list objects, write objects, Read bucket permissions, and Write bucket permissions access is given.</li>
  </ol>
  <p>I am able to list bucket contents from aws cli and it's not working with lambda.</p>