3

我是 cloudformation 的新手,我正在尝试按照 AWS 文档创建一个使用方法限制的使用计划。我需要定义一个带有 Throttle 属性的ApiStage 。

我尝试了以下方法,但出现错误 -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
4

1 回答 1

2

您需要指定要限制的路径和方法。例如:

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

where/helloworld/ANY必须换成自己的路径和方法。

希望这可以帮助。

于 2020-04-30T07:53:37.993 回答