UsagePlanProps¶
-
class
aws_cdk.aws_apigateway.
UsagePlanProps
(*, api_key=None, api_stages=None, description=None, name=None, quota=None, throttle=None)¶ Bases:
object
- Parameters
api_key (
Optional
[IApiKey
]) – (deprecated) ApiKey to be associated with the usage plan. Default: noneapi_stages (
Optional
[Sequence
[Union
[UsagePlanPerApiStage
,Dict
[str
,Any
]]]]) – API Stages to be associated with the usage plan. Default: nonedescription (
Optional
[str
]) – Represents usage plan purpose. Default: nonename (
Optional
[str
]) – Name for this usage plan. Default: nonequota (
Union
[QuotaSettings
,Dict
[str
,Any
],None
]) – Number of requests clients can make in a given time period. Default: nonethrottle (
Union
[ThrottleSettings
,Dict
[str
,Any
],None
]) – Overall throttle settings for the API. Default: none
- ExampleMetadata
infused
Example:
# integration: apigateway.LambdaIntegration api = apigateway.RestApi(self, "hello-api") v1 = api.root.add_resource("v1") echo = v1.add_resource("echo") echo_method = echo.add_method("GET", integration, api_key_required=True) plan = api.add_usage_plan("UsagePlan", name="Easy", throttle=apigateway.ThrottleSettings( rate_limit=10, burst_limit=2 ) ) key = api.add_api_key("ApiKey") plan.add_api_key(key)
Attributes
-
api_key
¶ (deprecated) ApiKey to be associated with the usage plan.
- Default
none
- Deprecated
use
addApiKey()
- Stability
deprecated
- Return type
Optional
[IApiKey
]
-
api_stages
¶ API Stages to be associated with the usage plan.
- Default
none
- Return type
Optional
[List
[UsagePlanPerApiStage
]]
-
description
¶ Represents usage plan purpose.
- Default
none
- Return type
Optional
[str
]
-
name
¶ Name for this usage plan.
- Default
none
- Return type
Optional
[str
]
-
quota
¶ Number of requests clients can make in a given time period.
- Default
none
- Return type
Optional
[QuotaSettings
]
-
throttle
¶ Overall throttle settings for the API.
- Default
none
- Return type
Optional
[ThrottleSettings
]