0
0
AWScloud~30 mins

API Gateway throttling in AWS - Mini Project: Build & Apply

Choose your learning style9 modes available
API Gateway Throttling Configuration
📖 Scenario: You are managing an API for a small online store. To protect your backend from too many requests at once, you want to set up throttling limits on your API Gateway. This will help keep your service stable and responsive for all users.
🎯 Goal: Configure an AWS API Gateway REST API with throttling limits that restrict the number of requests per second and burst capacity.
📋 What You'll Learn
Create an API Gateway REST API resource named MyApi.
Set a stage named prod for the API.
Configure throttling limits with a rate limit of 100 requests per second and a burst limit of 200.
Use AWS CloudFormation YAML syntax for the configuration.
💡 Why This Matters
🌍 Real World
API Gateway throttling is used to protect backend services from overload by limiting the number of requests clients can make in a given time.
💼 Career
Cloud engineers and DevOps professionals often configure throttling to ensure APIs remain reliable and performant under varying traffic loads.
Progress0 / 4 steps
1
Create the API Gateway REST API resource
Create a CloudFormation resource named MyApi of type AWS::ApiGateway::RestApi with the property Name set to MyApi.
AWS
Need a hint?

Use the Resources section to define your API Gateway REST API resource.

2
Add the deployment stage configuration
Add a CloudFormation resource named MyApiStage of type AWS::ApiGateway::Stage with the properties StageName set to prod and RestApiId referencing MyApi.
AWS
Need a hint?

Use !Ref MyApi to link the stage to the API.

3
Add throttling limits configuration
In the MyApiStage resource, add the MethodSettings property with a list containing one item. This item should have ResourcePath set to "/*", HttpMethod set to "*", and ThrottlingRateLimit set to 100 and ThrottlingBurstLimit set to 200.
AWS
Need a hint?

Use MethodSettings to configure throttling for all methods and resources.

4
Complete the CloudFormation template
Add the AWSTemplateFormatVersion set to "2010-09-09" at the top of the template to complete the CloudFormation YAML configuration.
AWS
Need a hint?

The AWSTemplateFormatVersion is required at the top of every CloudFormation template.