/
stage.ts
96 lines (85 loc) · 2.09 KB
/
stage.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import { Metric, MetricOptions } from '@aws-cdk/aws-cloudwatch';
import { IResource } from '@aws-cdk/core';
import { IDomainName } from './domain-name';
/**
* Represents a Stage.
*/
export interface IStage extends IResource {
/**
* The name of the stage; its primary identifier.
* @attribute
*/
readonly stageName: string;
/**
* The URL to this stage.
*/
readonly url: string;
/**
* Return the given named metric for this HTTP Api Gateway Stage
*
* @default - average over 5 minutes
*/
metric(metricName: string, props?: MetricOptions): Metric
}
/**
* Options for DomainMapping
*/
export interface DomainMappingOptions {
/**
* The domain name for the mapping
*
*/
readonly domainName: IDomainName;
/**
* The API mapping key. Leave it undefined for the root path mapping.
* @default - empty key for the root path mapping
*/
readonly mappingKey?: string;
}
/**
* Options required to create a new stage.
* Options that are common between HTTP and Websocket APIs.
*/
export interface StageOptions {
/**
* Whether updates to an API automatically trigger a new deployment.
* @default false
*/
readonly autoDeploy?: boolean;
/**
* The options for custom domain and api mapping
*
* @default - no custom domain and api mapping configuration
*/
readonly domainMapping?: DomainMappingOptions;
/**
* Throttle settings for the routes of this stage
*
* @default - no throttling configuration
*/
readonly throttle?: ThrottleSettings;
}
/**
* The attributes used to import existing Stage
*/
export interface StageAttributes {
/**
* The name of the stage
*/
readonly stageName: string;
}
/**
* Container for defining throttling parameters to API stages
*/
export interface ThrottleSettings {
/**
* The API request steady-state rate limit (average requests per second over an extended period of time)
* @default none
*/
readonly rateLimit?: number;
/**
* The maximum API request rate limit over a time ranging from one to a few seconds.
* @default none
*/
readonly burstLimit?: number;
}