title: AWS. S3. How to get list of objects by bucket (listObjectsV2)?
body: <p>I need to get list of objects from my AWS s3 bucket. I try:</p>
  <pre><code>const s3 = new AWS.S3();
  
  const params = {
      Bucket: &quot;arn:aws:s3:::test-bucket-n-i&quot;,
      MaxKeys: 10
  };
  s3.listObjectsV2(params, function(err, data) {
      if (err) console.log(err, err.stack); // an error occurred
      else     console.log(data);           // successful response
  });
  </code></pre>
  <p>This Arn I copied form my test bucket. As result I get:</p>
  <pre><code> InvalidARN: ARN accountID does not match regex &quot;[0-9]{12}&quot;
  
  </code></pre>
  <p>How can it be invalid? How can I call s3.listObjectsV2 without creating an Access point?</p>