Create API Gateway

Create API Gateway

In this step, we will proceed to create a REST API on API Gateway to trigger Lambda events and forward requests to Lambda events.

  1. Access the API Gateway service management interface.
  2. Look for REST API and select Build.

api

  1. Under API name, enter S3 Upload, leave the rest as default.
    • Click Create API.

api

  1. Click Create resource under the Resources section.

api

  1. In the Resource name field, enter upload.
    • Click Create resource.

api

  1. Click Create method.

api

  1. On the Create method page:
    • Set Method type to POST.
    • Enable Lambda proxy integration.
    • Under Lambda function, select the s3-upload function you created earlier.
    • Click Create method.

api

  1. From the left sidebar, select API settings.
    • Under Binary media types, choose Manage media types.

api

  1. On the Manage binary media types page:
    • Select Add binary media type and add:
      • */*
      • multipart/form-data
    • Click Save changes.

api

  1. From the left sidebar, select Resources.
    • Choose Deploy API.

api

  1. Under Stage, select *New stage*.
    • Set Stage name to staging.
    • Click Deploy.

api

  1. Copy the Invoke URL and proceed to the next step.

api