@fntio/infra-client
Version:
Self-hosted AWS access portal: credential vending, target-account trust, and grant-driven private networking as CDK stacks and constructs.
17 lines (16 loc) • 988 B
TypeScript
/** API Gateway stage throttle on the vending API: the DEPLOYMENT-WIDE ceiling on requests per second across every
* caller, including direct `execute-api` hits that bypass CloudFront's WAF. Not a per-caller limit (that is
* `waf.perTokenRateLimit`); size it for everyone's page loads at once (one page load is 10–15 calls). Wiki: Security Posture. */
export interface ApiThrottleConfig {
/** Sustained requests per second for the whole stage. Default 100. */
readonly rateLimit?: number;
/** Requests the stage absorbs at once above the sustained rate (token bucket). Default 200. */
readonly burstLimit?: number;
}
export interface ApiThrottle {
readonly rateLimit: number;
readonly burstLimit: number;
}
export declare const DEFAULT_API_THROTTLE: ApiThrottle;
/** Validated at synth; the bounds are API Gateway's own account-level ceilings (10,000 rps, 5,000 burst). */
export declare function resolveApiThrottle(config?: ApiThrottleConfig): ApiThrottle;