Search⌘ K
AI Features

Using Global Settings to Configure the Implicit API

Explore how to configure the implicit API in AWS SAM by adjusting global settings to choose between edge-optimized and regional API Gateway endpoints. Understand how these configurations impact request routing, headers from CloudFront, and connection latency for global versus local users. This lesson guides you through modifying your template to specify endpoint types and demonstrates building and deploying the updated stack to optimize serverless application performance.

With the Lambda Proxy integration, API Gateway just packages all the request properties and forwards them to Lambda. However, if you look at one of the request logs carefully (see figure here), you’ll notice some headers that do not look like they are coming from a browser. For example, CloudFront-Viewer-Country shows the ISO country code where the request originated. This is because the request did not go directly from a browser to API Gateway. Instead, it first went to the AWS global content distribution system called CloudFront, which put in some additional headers.

API Gateway configurations #

SAM can set up two types of API Gateway configuration:

  1. edge-optimised
  2. regional

Edge-optimised APIs

...