Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Throttle unauthenticated (no API Key) requests on API Gateway

I'd like to provide a free tier for my API and allow new users to test drive it without having to sign up for an API key.

Is there a way that I can set a limit/quota and throttle requests that have no api key on API Gateway?

like image 728
Jonathan Avatar asked Sep 21 '17 07:09

Jonathan


People also ask

How do I enable throttling on AWS API gateway?

You can set additional throttling targets at the method level in Usage Plans as shown in Create a usage plan. In the API Gateway console, these are set by specifying Resource= <resource> , Method= <method> in the Configure Method Throttling setting.

What is throttling in API gateway?

API throttling is the process of limiting the number of API requests a user can make in a certain period. An application programming interface (API) functions as a gateway between a user and a software application.

How do you handle a throttling API?

Best practices to handle throttling The following are best practices for handling throttling: Reduce the degree of parallelism. Reduce the frequency of calls. Avoid immediate retries because all requests accrue against your usage limits.


1 Answers

Yes, essentially there are two places where you can configure your throttling options:

  1. In usage plans. You link API Key to usage plan and configure method request to require API key. http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-usage-plans.html

  2. n stage settings you can configure default throttling method - this will be applicable to any request (no API key required). http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-request-throttling.html

what you are looking is 2.

by the way, very important moment - be aware that API Keys are not a security mechanism - you should not use API for authentication purposes.

like image 124
Nicholas Avatar answered Sep 30 '22 16:09

Nicholas