AWS API Gateway – First Look

AWS API Gateway makes it easy to deploy API endpoints in the cloud with minimal effort.

This can be a great way to provide service endpoints for SaaS applications. As the journey toward an upgraded user experience for the Store Locator Plus® SaaS progresses new technology is being included in the platform architecture. Moving pieces of that platform away from a WordPress-centric architecture to a generalized cloud services architecture led us to dive deeper into the AWS API Gateway service.

REST API vs. HTTP API

One of the first decisions is to determine what type of API you want to roll out on the AWS platform. For most business applications a REST API is preferable. REST APIs can be edge optimized, and private where HTTP APIs are not. REST APIs can be set to only allow certified access via tokens or certificates and can be hidden behind a web application firewall. REST APIs can also be throttled on a per-client basis.

Getting Started

Amazon API Gateway has a decent Getting Started guide. Follow that guide for the first test run.

Notes

Lambda

All API request route through Lambda.

Create a simple Lambda function “my-function”:

exports.handler = async (event) => {
    const response = {
        statusCode: 200,
        body: JSON.stringify('Hello from Lambda!'),
    };
    return response;
};

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.