Period Enum
Time period for which quota settings apply.
| Source | aws-apigateway/lib/usage-plan.ts |
|---|
Example
ts
declare const api: apigateway.RestApi;
const key = new apigateway.RateLimitedApiKey(this, 'rate-limited-api-key', {
customerId: 'hello-customer',
apiStages: [{ stage: api.deploymentStage }],
quota: {
limit: 10000,
period: apigateway.Period.MONTH
}
});
python
# api: apigateway.RestApi
key = apigateway.RateLimitedApiKey(self, "rate-limited-api-key",
customer_id="hello-customer",
api_stages=[apigateway.UsagePlanPerApiStage(stage=api.deployment_stage)],
quota=apigateway.QuotaSettings(
limit=10000,
period=apigateway.Period.MONTH
)
)
java
RestApi api;
RateLimitedApiKey key = RateLimitedApiKey.Builder.create(this, "rate-limited-api-key")
.customerId("hello-customer")
.apiStages(List.of(UsagePlanPerApiStage.builder().stage(api.getDeploymentStage()).build()))
.quota(QuotaSettings.builder()
.limit(10000)
.period(Period.MONTH)
.build())
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
RestApi api;
var key = new RateLimitedApiKey(this, "rate-limited-api-key", new RateLimitedApiKeyProps {
CustomerId = "hello-customer",
ApiStages = new [] { new UsagePlanPerApiStage { Stage = api.DeploymentStage } },
Quota = new QuotaSettings {
Limit = 10000,
Period = Period.MONTH
}
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var api RestApi
key := apigateway.NewRateLimitedApiKey(this, jsii.String("rate-limited-api-key"), &RateLimitedApiKeyProps{
CustomerId: jsii.String("hello-customer"),
ApiStages: []UsagePlanPerApiStage{
&UsagePlanPerApiStage{
Stage: api.DeploymentStage,
},
},
Quota: &QuotaSettings{
Limit: jsii.Number(10000),
Period: apigateway.Period_MONTH,
},
})
Members
| Member | Description |
|---|---|
DAY | |
WEEK | |
MONTH |
Referenced by
QuotaSettings.periodperiodperiodPeriodPeriod