title: Access Denied when using Lamda Edge with CloudFront to access S3
body: <p>I have a CloudFront setup from which I want to serve static file content placed S3 buckets ( will have many sub folders).</p>
  
  <p>I want to route request to different folders within bucket based on query string.<br>
  In my Lamda Edge function which I have added as trigger for CloudFront I do following </p>
  
  <pre><code>const request = event.Records[0].cf.request;
  request.origin.s3.path = "/" + folderName + request.uri
  callback(null, request);
  </code></pre>
  
  <p>But when I access CloudFront via its url I get "AccessDenied" error. Not sure how to debug this.
  My S3 bucket files are public and I can access them using proper s3 urls.</p>
  
  <p>Any help here will be great.</p>
  
  <p>thanks</p>