interface UsagePlanProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.APIGateway.UsagePlanProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsapigateway#UsagePlanProps |
![]() | software.amazon.awscdk.services.apigateway.UsagePlanProps |
![]() | aws_cdk.aws_apigateway.UsagePlanProps |
![]() | aws-cdk-lib » aws_apigateway » UsagePlanProps |
Example
declare const integration: apigateway.LambdaIntegration;
const api = new apigateway.RestApi(this, 'hello-api');
const v1 = api.root.addResource('v1');
const echo = v1.addResource('echo');
const echoMethod = echo.addMethod('GET', integration, { apiKeyRequired: true });
const plan = api.addUsagePlan('UsagePlan', {
name: 'Easy',
throttle: {
rateLimit: 10,
burstLimit: 2
}
});
const key = api.addApiKey('ApiKey');
plan.addApiKey(key);
Properties
Name | Type | Description |
---|---|---|
api | Usage [] | API Stages to be associated with the usage plan. |
description? | string | Represents usage plan purpose. |
name? | string | Name for this usage plan. |
quota? | Quota | Number of requests clients can make in a given time period. |
throttle? | Throttle | Overall throttle settings for the API. |
apiStages?
Type:
Usage
[]
(optional, default: none)
API Stages to be associated with the usage plan.
description?
Type:
string
(optional, default: none)
Represents usage plan purpose.
name?
Type:
string
(optional, default: none)
Name for this usage plan.
quota?
Type:
Quota
(optional, default: none)
Number of requests clients can make in a given time period.
throttle?
Type:
Throttle
(optional, default: none)
Overall throttle settings for the API.