Provision a Metered REST API
A 6-step recipe with Amazon API Gateway. We can help you get access.
Recipe · 6 steps
Provision a Metered REST API
with Amazon API Gateway
Create a REST API, attach a key-aware method, and branch into metering when required.
- Create the REST API container.
- List resources to obtain the root resource id.
- Attach the method to the root resource, honoring the api-key requirement.
- Create an API key to meter access to the key-protected method.
- Create a usage plan to govern the API key.
- Create a deployment to publish the API to the named stage.
What you'll need to have ready
- name: Name of the new REST API.
- httpMethod: HTTP verb to add to the root resource.
- authorizationType: Authorization type for the method.
- apiKeyRequired: Whether the method requires an API key.
- keyName: Name of the API key to create when one is required.
- planName: Name of the usage plan to create when a key is required.
- stageName: Stage to deploy the API to.
For your developer
Arazzo workflow aws-api-gateway:metered-rest-api, 6 operations: CreateRestApi → GetResources → PutMethod → CreateApiKey → CreateUsagePlan → CreateDeployment. Specs on APIs.io.