Amazon API Gateway is a fully managed service that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale. With a few clicks in the AWS Management Console, you can create an API that acts as a “front door” for applications to access data, business logic, or functionality from your back-end services, such as workloads running on Amazon Elastic Compute Cloud (Amazon EC2), code running on AWS Lambda, or any Web application. Amazon API Gateway handles all the tasks involved in accepting and processing up to hundreds of thousands of concurrent API calls, including traffic management, authorization and access control, monitoring, and API version management. Amazon API Gateway has no minimum fees or startup costs. You pay only for the API calls you receive and the amount of data transferred out.
Setting up a REST API¶
The name of the resource. This is a uri, for example
There will be an implict
/resource created, which you can attach other resources to:
resource = rest_api.get_resource(name='/') animal = resource.add_resource( name='/animal', )
The resource this resource is attached to:
dog = rest_api.add_resource( name='/animal/dog', parent_resource=animal, )
This is optional if you attach a resource directly:
dog = animal.add_resource(name='/animal/dog')
A stage defines the path through which an API deployment is accessible. With deployment stages, you can have multiple releases for each API, such as alpha, beta, and production. Using stage variables you can configure an API deployment stage to interact with different backend endpoints.