title: Resize Images on the Fly with AWS Lambda and Amazon API Gateway
body: <p>I followed the tutorial on this page <a href="https://aws.amazon.com/blogs/compute/resize-images-on-the-fly-with-amazon-s3-aws-lambda-and-amazon-api-gateway/" rel="nofollow noreferrer">HERE</a>
  but when I try to get a resized picture I get an "Access Denied"</p>
  
  <p>Good: <a href="https://xxxx.amazonaws.com/mybucket/test.jpg" rel="nofollow noreferrer">https://xxxx.amazonaws.com/mybucket/test.jpg</a><br>
  Error: <a href="https://xxxx.amazonaws.com/mybucket/300x300/test.jpg" rel="nofollow noreferrer">https://xxxx.amazonaws.com/mybucket/300x300/test.jpg</a> (access denied)</p>
  
  <pre><code>&lt;Error&gt;
  &lt;Code&gt;AccessDenied&lt;/Code&gt;
  &lt;Message&gt;Access Denied&lt;/Message&gt;
  &lt;/Error&gt;
  </code></pre>
  
  <p>Below my settings:</p>
  
  <p>Bucket policy editor</p>
  
  <pre><code>{
      "Version": "2012-10-17",
      "Statement": [
          {
              "Sid": "AddPerm",
              "Effect": "Allow",
              "Principal": "*",
              "Action": "s3:GetObject",
              "Resource": "arn:aws:s3:::mybucket/*"
          }
      ]
  }
  </code></pre>
  
  <p>When I created the trigger, I selected Security: OPEN. I'm just confused about the <strong>YOUR_API_HOSTNAME_HERE</strong>. In the example, the api hostname is h3ll0w0rld?</p>