ApiGatewayV1UsagePlan
Reference doc for the `sst.aws.ApiGatewayV1UsagePlan` component.
The ApiGatewayV1UsagePlan
component is internally used by the ApiGatewayV1
component
to add usage plans to Amazon API Gateway REST API.
You’ll find this component returned by the addUsagePlan
method of the ApiGatewayV1
component.
Constructor
new ApiGatewayV1UsagePlan(name, args, opts?)
Parameters
-
name
string
-
args
UsagePlanArgs
-
opts?
ComponentResourceOptions
Properties
nodes
nodes.usagePlan
Type UsagePlan
The API Gateway Usage Plan.
Methods
addApiKey
addApiKey(name, args?)
Parameters
The name of the API key.name
string
Configure the API key.args?
ApiGatewayV1ApiKeyArgs
Returns ApiGatewayV1ApiKey
Add an API key to the API Gateway usage plan.
plan.addApiKey("MyKey", { value: "d41d8cd98f00b204e9800998ecf8427e",});
UsagePlanArgs
apiId
Type Input
<
string
>
The API Gateway REST API to use for the usage plan.
apiStage
Type Input
<
string
>
The stage of the API Gateway REST API.
quota?
Type Input
<
Object
>
Configure a cap on the total number of requests allowed within a specified time period.
{ quota: { limit: 1000, period: "month", offset: 0, }}
quota.limit
Type Input
<
number
>
The maximum number of requests that can be made in the specified period.
quota.offset?
Type Input
<
number
>
The number of days into the period when the quota counter is reset. For example, with period=“month” and offset=0, the quota is reset at the beginning of each month.
quota.period
Type Input
<
“
day
”
|
“
week
”
|
“
month
”
>
The time period for which the quota applies.
throttle?
Type Input
<
Object
>
Configure a rate limits to protect your API from being overwhelmed by too many requests at once.
{ throttle: { rate: 100, burst: 200, }}
throttle.burst?
Type Input
<
number
>
The maximum number of requests permitted in a short-term spike beyond the rate limit.
throttle.rate?
Type Input
<
number
>
The steady-state maximum number of requests allowed per second.