aws-cdk-lib.aws_apigateway.UsagePlanProps

interface UsagePlanProps

LanguageType name
.NETAmazon.CDK.AWS.APIGateway.UsagePlanProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsapigateway#UsagePlanProps
Javasoftware.amazon.awscdk.services.apigateway.UsagePlanProps
Pythonaws_cdk.aws_apigateway.UsagePlanProps
TypeScript (source)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

NameTypeDescription
apiStages?UsagePlanPerApiStage[]API Stages to be associated with the usage plan.
description?stringRepresents usage plan purpose.
name?stringName for this usage plan.
quota?QuotaSettingsNumber of requests clients can make in a given time period.
throttle?ThrottleSettingsOverall throttle settings for the API.

apiStages?

Type: UsagePlanPerApiStage[] (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: QuotaSettings (optional, default: none)

Number of requests clients can make in a given time period.


throttle?

Type: ThrottleSettings (optional, default: none)

Overall throttle settings for the API.