AWS API Gateway Introduction
Today API's are the hot thing, and for good reason. The add simplicity and flexibility to complex data architectures. API Gateway offers the ability to create RESTful APIs and WebSocket APIs within the AWS Cloud Platform. API Gateway also supports serverless, containerized workloads.
Amazon API Gateway is an AWS service for creating, publishing, maintaining, monitoring, and securing REST, HTTP, and WebSocket APIs at any scale. Developers can create API access to any web service connected to the internet. This include AWS Cloud services and services not within the AWS Cloud.
API Types
- RESTful APIs - Optimized for serverless workloads and HTTP backend
- HTTP based
- Enabled stateless client-server communication
- Standard GET, POST, PUT, PATCH AND DELETE HTTP methods
- WebSocket APIs - Real-time two way communication between applications
- Adheres to the WebSocket protocol, which enables stateful, full-duplex communication between client and server.
- Route incoming messages based on message content.
Benefits
- Efficient API development - The ability to run multiple versions of an API that can be quickly tested and released
- Performance at any scale - Using the AWS global structure keeps performance high and scaling easy
- Cost savings at scale - Different tiering plans allow for cost flexibility as requests grow
- Easy monitoring - Easy integration with CloudWatch to monitor API usage, latency, error rates and more.
- Flexible security controls - Leverage IAM and Cognito to finely tune access, as well as, OAuth 2 and OIDC support.
- RESTful API options - Easily create and customize your RESTful APIs
Lambdas
Using API Gateway with AWS Lambdas allows for the app-facing part of the AWS serverless infrastructure.
Stream line a web application by hosting it on AWS Lambda. Then expose lambda functions through API Gateway. Both services are highly available ,scalable
and can be monitored through CloudWatch. This greatly simplifies development and administration efforts.
Access API Gateway
AWS allows access to API Gateway through several means:
- AWS Management Console
- AWS SDKs
- API Gateway V1 and V2 APIs
- AWS CLI
- AWS Tools for Windows PowerShell
Pricing
HTTP and REST API
API Gateway charges for what you use. The charges are for number of API calls and the amount of data transferred out. There is no upfront fees are setup charges.
There are options for Private APIs and data caching that can also affect charges.
WebSocket API
WebSocket APIs only incur a charge when messages are sent and received and connection minutes
Free Tier
If you are still on the Free Tier, you have 1,000,000 API calls and 1,000,000 messages and 750,000 connection minutes available.
After Free Tier Expires
Charges after the free tier vary. Consult the prices page to learn more about API Gateway pricing. Learn More
Conclusion
AWS API Gateway allows for a easy, secure, and scalable way to expose a web application through a RESTful service. Used with Lambda and other AWS services, you can quickly develop, test and deploy web interfaces.
In Addition, it is a service that offers Free Tier access. This makes it is easy to test and try with out buying.