generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 82
Expand file tree
/
Copy pathindex.ts
More file actions
230 lines (200 loc) · 5.88 KB
/
index.ts
File metadata and controls
230 lines (200 loc) · 5.88 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
import type { CloudFormationStackArtifact } from '@aws-cdk/cx-api';
import type { BaseDeployOptions } from './private/deploy-options';
import type { Tag } from '../../api/aws-cdk';
export type DeploymentMethod = DirectDeploymentMethod | ChangeSetDeploymentMethod;
export interface DirectDeploymentMethod {
/**
* Use stack APIs to the deploy stack changes
*/
readonly method: 'direct';
}
export interface ChangeSetDeploymentMethod {
/**
* Use change-set APIS to deploy a stack changes
*/
readonly method: 'change-set';
/**
* Whether to execute the changeset or leave it in review.
*
* @default true
*/
readonly execute?: boolean;
/**
* Optional name to use for the CloudFormation change set.
* If not provided, a name will be generated automatically.
*/
readonly changeSetName?: string;
}
/**
* When to build assets
*/
export enum AssetBuildTime {
/**
* Build all assets before deploying the first stack
*
* This is intended for expensive Docker image builds; so that if the Docker image build
* fails, no stacks are unnecessarily deployed (with the attendant wait time).
*/
ALL_BEFORE_DEPLOY = 'all-before-deploy',
/**
* Build assets just-in-time, before publishing
*/
JUST_IN_TIME = 'just-in-time',
}
export enum RequireApproval {
/**
* Never require any security approvals
*/
NEVER = 'never',
/**
* Any security changes require an approval
*/
ANY_CHANGE = 'any-change',
/**
* Require approval only for changes that are access broadening
*/
BROADENING = 'broadening',
}
export enum HotswapMode {
/**
* Will fall back to CloudFormation when a non-hotswappable change is detected
*/
FALL_BACK = 'fall-back',
/**
* Will not fall back to CloudFormation when a non-hotswappable change is detected
*/
HOTSWAP_ONLY = 'hotswap-only',
/**
* Will not attempt to hotswap anything and instead go straight to CloudFormation
*/
FULL_DEPLOYMENT = 'full-deployment',
}
export class StackParameters {
/**
* Use only existing parameters on the stack.
*/
public static onlyExisting() {
return new StackParameters({}, true);
}
/**
* Use exactly these parameters and remove any other existing parameters from the stack.
*/
public static exactly(params: { [name: string]: string | undefined }) {
return new StackParameters(params, false);
}
/**
* Define additional parameters for the stack, while keeping existing parameters for unspecified values.
*/
public static withExisting(params: { [name: string]: string | undefined }) {
return new StackParameters(params, true);
}
public readonly parameters: Map<string, string | undefined>;
public readonly keepExistingParameters: boolean;
private constructor(params: { [name: string]: string | undefined }, usePreviousParameters = true) {
this.keepExistingParameters = usePreviousParameters;
this.parameters = new Map(Object.entries(params));
}
}
export interface DeployOptions extends BaseDeployOptions {
/**
* ARNs of SNS topics that CloudFormation will notify with stack related events
*/
readonly notificationArns?: string[];
/**
* Require a confirmation for security relevant changes before continuing with the deployment
*
* @default RequireApproval.NEVER
* @deprecated in future a message containing the full diff will be emitted and a response requested.
* Approval workflows should be implemented in the `IIoHost`.
*/
readonly requireApproval?: RequireApproval;
/**
* Tags to pass to CloudFormation for deployment
*/
readonly tags?: Tag[];
/**
* Stack parameters for CloudFormation used at deploy time
* @default StackParameters.onlyExisting()
*/
readonly parameters?: StackParameters;
/**
* Path to file where stack outputs will be written after a successful deploy as JSON
* @default - Outputs are not written to any file
*/
readonly outputsFile?: string;
/**
* Build/publish assets for a single stack in parallel
*
* Independent of whether stacks are being done in parallel or no.
*
* @default true
*/
readonly assetParallelism?: boolean;
/**
* When to build assets
*
* The default is the Docker-friendly default.
*
* @default AssetBuildTime.ALL_BEFORE_DEPLOY
*/
readonly assetBuildTime?: AssetBuildTime;
/**
* Change stack watcher output to CI mode.
*
* @deprecated has no functionality, please implement in your IoHost
*/
readonly ci?: boolean;
/**
* Display mode for stack deployment progress.
*
* @deprecated has no functionality, please implement in your IoHost
*/
readonly progress?: any;
/**
* Represents configuration property overrides for hotswap deployments.
* Currently only supported by ECS.
*
* @default - no overrides
*/
readonly hotswapProperties?: HotswapProperties;
}
/**
* Property overrides for ECS hotswaps
*/
export interface EcsHotswapProperties {
/**
* The lower limit on the number of your service's tasks that must remain
* in the RUNNING state during a deployment, as a percentage of the desiredCount.
*/
readonly minimumHealthyPercent: number;
/**
* The upper limit on the number of your service's tasks that are allowed
* in the RUNNING or PENDING state during a deployment, as a percentage of the desiredCount.
*/
readonly maximumHealthyPercent: number;
}
/**
* Property overrides for hotswap deployments.
*/
export interface HotswapProperties {
/**
* ECS specific hotswap property overrides
*/
readonly ecs: EcsHotswapProperties;
}
export interface StackDeployProgress {
/**
* The total number of stacks being deployed
*/
readonly total: number;
/**
* The count of the stack currently attempted to be deployed
*
* This is counting value, not an identifier.
*/
readonly current: number;
/**
* The stack that's currently being deployed
*/
readonly stack: CloudFormationStackArtifact;
}