UsagePlanPerApiStage

class aws_cdk.aws_apigateway.UsagePlanPerApiStage(*, api=None, stage=None, throttle=None)

Bases: object

Represents the API stages that a usage plan applies to.

Parameters
  • api (Optional[IRestApi]) – Default: none

  • stage (Optional[Stage]) – [disable-awslint:ref-via-interface]. Default: none

  • throttle (Optional[Sequence[ThrottlingPerMethod]]) – Default: none

Example:

# plan is of type UsagePlan
# api is of type RestApi
# echo_method is of type Method


plan.add_api_stage(
    stage=api.deployment_stage,
    throttle=[apigateway.ThrottlingPerMethod(
        method=echo_method,
        throttle=apigateway.ThrottleSettings(
            rate_limit=10,
            burst_limit=2
        )
    )
    ]
)

Attributes

api

none

Type

default

Return type

Optional[IRestApi]

stage

ref-via-interface].

Default

none

Type

[disable-awslint

Return type

Optional[Stage]

throttle

none

Type

default

Return type

Optional[List[ThrottlingPerMethod]]