Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloudformation for UsagePlan with Method Throttling

I am new to cloudformation, I am trying to follow the AWS doc to create a Usage Plan with Method throttling. I need to define an ApiStage with Throttle attribute.

I tried below approach but got an error - Value of property Throttle must be an object with String (or simple type) properties

  ApiUsagePlan:
    Type: "AWS::ApiGateway::UsagePlan"
    Properties:
      Throttle:
        RateLimit: 10
        BurstLimit: 10
      ApiStages:
      - ApiId: !Ref ApiGatewayApi
        Stage: !Ref ApiStage
        Throttle: -------> how to define this property?
          RateLimit: 5
          BurstLimit: 5
like image 263
Ajay Avatar asked Oct 18 '25 19:10

Ajay


1 Answers

You need to specify path and method to be throttled. For example:

  ApiStages:
    - ApiId: !Ref ApiGatewayApi
      Stage: !Ref ApiStage
      Throttle:
        "/helloworld/ANY":
            BurstLimit: 5
            RateLimit: 5

Where /helloworld/ANY must be replaced by your own path and method.

Hope this helps.

like image 105
Marcin Avatar answered Oct 21 '25 15:10

Marcin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!