@fntio/infra-client
Version:
Self-hosted AWS access portal: credential vending, target-account trust, and grant-driven private networking as CDK stacks and constructs.
18 lines (17 loc) • 1.08 kB
TypeScript
/** API Gateway stage throttle on the vending API — the DEPLOYMENT-WIDE ceiling on requests per second across
* every caller (people, service users, tokens, the import CLI) and on direct `execute-api` hits that bypass
* CloudFront's WAF. It is not a per-caller limit: a leaked or runaway token is bounded by `waf.perTokenRateLimit`.
* Size it for everyone's page loads at once (one page load is 10–15 API 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;