-
Notifications
You must be signed in to change notification settings - Fork 4.5k
(aws-apigateway): cannot set usage plan throttle rate limit to decimal value #18994
Description
What is the problem?
When attempting to set an API Gateway (v1) usage plan throttling rate limit to a double (i.e. decimal value) I receive an error stating that the value should be an integer. This restriction is not present in the AWS Console, and is contradicted by the AWS CLI documentation: https://docs.aws.amazon.com/cli/latest/reference/apigateway/create-usage-plan.html
rateLimit -> (double)
Reproduction Steps
api.addUsagePlan("usage-plan", {
throttle: {
rateLimit: 0.033, // requests per second (1 request every 30 seconds)
burstLimit: 1,
}
});
What did you expect to happen?
cdk synth should not throw any errors.
What actually happened?
cdk synth throws: Throttle rate limit should be an integer
CDK CLI Version
1.144.0
Framework Version
No response
Node.js Version
16.13.2
OS
Ubuntu 20.04
Language
Typescript
Language Version
No response
Other information
Bug appears to occur on this line of code: https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/aws-apigateway/lib/usage-plan.ts#L319
Removing the integer validation of rate limit would seem to be the correct fix.