What is Amazon API Gateway?
Amazon API Gateway is an AWS service for creating, publishing, maintaining, monitoring, and
securing REST, HTTP, and WebSocket APIs at any scale. API developers can create APIs that
access AWS or other web services, as well as data stored in the AWS Cloud
API Gateway creates RESTful APIs that:
-
Are HTTP-based.
-
Enable stateless client-server communication.
-
Implement standard HTTP methods such as GET, POST, PUT, PATCH, and DELETE.
For more information about API Gateway REST APIs and HTTP APIs, see Choose between REST APIs and HTTP APIs, API Gateway HTTP APIs, Use API Gateway to create REST APIs, and Develop REST APIs in API Gateway.
API Gateway creates WebSocket APIs that:
-
Adhere to the WebSocket
protocol, which enables stateful, full-duplex communication between client and server. -
Route incoming messages based on message content.
For more information about API Gateway WebSocket APIs, see Use API Gateway to create WebSocket APIs and Overview of WebSocket APIs in API Gateway.
Topics
Architecture of API Gateway
The following diagram shows API Gateway architecture.
This diagram illustrates how the APIs you build in Amazon API Gateway provide you or your developer customers with an integrated and consistent developer experience for building AWS serverless applications. API Gateway handles all the tasks involved in accepting and processing up to hundreds of thousands of concurrent API calls. These tasks include traffic management, authorization and access control, monitoring, and API version management.
API Gateway acts as a "front door" for applications to access data, business logic, or functionality from your backend services, such as workloads running on Amazon Elastic Compute Cloud (Amazon EC2), code running on AWS Lambda, any web application, or real-time communication applications.
Features of API Gateway
Amazon API Gateway offers features such as the following:
-
Support for stateful (WebSocket) and stateless (HTTP and REST) APIs.
-
Powerful, flexible authentication mechanisms, such as AWS Identity and Access Management policies, Lambda authorizer functions, and Amazon Cognito user pools.
-
Canary release deployments for safely rolling out changes.
-
CloudTrail logging and monitoring of API usage and API changes.
-
CloudWatch access logging and execution logging, including the ability to set alarms. For more information, see Monitor REST API execution with Amazon CloudWatch metrics and Monitor WebSocket API execution with CloudWatch metrics.
-
Ability to use AWS CloudFormation templates to enable API creation. For more information, see Amazon API Gateway Resource Types Reference and Amazon API Gateway V2 Resource Types Reference.
-
Support for custom domain names.
-
Integration with AWS WAF for protecting your APIs against common web exploits.
-
Integration with AWS X-Ray for understanding and triaging performance latencies.
For a complete list of API Gateway feature releases, see Document history.
Accessing API Gateway
You can access Amazon API Gateway in the following ways:
-
AWS Management Console – The AWS Management Console provides a web interface for creating and managing APIs. After you complete the steps in Set up to use API Gateway, you can access the API Gateway console at https://console.aws.amazon.com/apigateway
. -
AWS SDKs – If you're using a programming language that AWS provides an SDK for, you can use an SDK to access API Gateway. SDKs simplify authentication, integrate easily with your development environment, and provide access to API Gateway commands. For more information, see Tools for Amazon Web Services
. -
API Gateway V1 and V2 APIs – If you're using a programming language that an SDK isn't available for, see the Amazon API Gateway Version 1 API Reference and Amazon API Gateway Version 2 API Reference.
-
AWS Command Line Interface – For more information, see Getting Set Up with the AWS Command Line Interface in the AWS Command Line Interface User Guide.
-
AWS Tools for Windows PowerShell – For more information, see Setting Up the AWS Tools for Windows PowerShell in the AWS Tools for Windows PowerShell User Guide.
Part of AWS serverless infrastructure
Together with AWS Lambda, API Gateway forms the app-facing part of the AWS serverless infrastructure. To learn more about getting started with serverless, see the Serverless Developer Guide.
For an app to call publicly available AWS services, you can use Lambda to interact with required services and expose Lambda functions through API methods in API Gateway. AWS Lambda runs your code on a highly available computing infrastructure. It performs the necessary execution and administration of computing resources. To enable serverless applications, API Gateway supports streamlined proxy integrations with AWS Lambda and HTTP endpoints.
How to get started with Amazon API Gateway
For an introduction to Amazon API Gateway, see the following:
-
Get started with API Gateway, which provides a walkthrough for creating an HTTP API.
-
Serverless land
, which provides instructional videos. -
Happy Little API Shorts
, which is a series of brief instructional videos.