Created
October 30, 2024 14:28
-
-
Save Pelirrojo/8a9dbac5298d8ec527915c2b6386a382 to your computer and use it in GitHub Desktop.
Phase 3: Fine-Tuning | Implement Request Throttling in API Gateway
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A vantablack friday: How to be prepared to stop DDoS Attacks after Halloween | |
# https://blog.evereven.tech | |
# Get API GW IDs and stage names | |
aws apigateway get-rest-apis --query 'items[*].[id,name]' --output json | |
> [ | |
> [ | |
> "abc123xyz", | |
> "my-api" | |
> ] | |
> ] | |
aws apigateway get-stages --rest-api-id <API-ID> --query 'item[*].[stageName]' --output json | |
> [ | |
> ["prod"], | |
> ["dev"], | |
> ["test"] | |
> ] | |
# Apply throttling (replace [API-ID] & [STAGE]) | |
aws apigateway update-stage \ | |
--rest-api-id [API-ID] \ | |
--stage-name [STAGE] \ | |
--patch-operations \ | |
op='replace',path='/throttling/rateLimit',value='50' \ | |
op='replace',path='/throttling/burstLimit',value='100' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment