-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
deploy.ts
170 lines (147 loc) · 3.98 KB
/
deploy.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
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
import { SharedOptions, RequireApproval } from './common';
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',
}
/**
* Options to use with cdk deploy
*/
export interface DeployOptions extends SharedOptions {
/**
* Only perform action on the given stack
*
* @default false
*/
readonly exclusively?: boolean;
/**
* Name of the toolkit stack to use/deploy
*
* @default CDKToolkit
*/
readonly toolkitStackName?: string;
/**
* Reuse the assets with the given asset IDs
*
* @default - do not reuse assets
*/
readonly reuseAssets?: string[];
/**
* Optional name to use for the CloudFormation change set.
* If not provided, a name will be generated automatically.
*
* @default - auto generate a name
*/
readonly changeSetName?: string;
/**
* Always deploy, even if templates are identical.
*
* @default false
*/
readonly force?: boolean;
/**
* Rollback failed deployments
*
* @default true
*/
readonly rollback?: boolean;
/**
* ARNs of SNS topics that CloudFormation will notify with stack related events
*
* @default - no notifications
*/
readonly notificationArns?: string[];
/**
* What kind of security changes require approval
*
* @default RequireApproval.Never
*/
readonly requireApproval?: RequireApproval;
/**
* Whether to execute the ChangeSet
* Not providing `execute` parameter will result in execution of ChangeSet
* @default true
*/
readonly execute?: boolean;
/*
* Whether to perform a 'hotswap' deployment.
* A 'hotswap' deployment will attempt to short-circuit CloudFormation
* and update the affected resources like Lambda functions directly. Do not use this in production environments
*
* @default - `HotswapMode.FULL_DEPLOYMENT` for regular deployments, `HotswapMode.HOTSWAP_ONLY` for 'watch' deployments
*/
readonly hotswap?: HotswapMode;
/**
* Additional parameters for CloudFormation at deploy time
* @default {}
*/
readonly parameters?: { [name: string]: string };
/**
* Use previous values for unspecified parameters
*
* If not set, all parameters must be specified for every deployment.
*
* @default true
*/
readonly usePreviousParameters?: boolean;
/**
* 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;
/**
* Whether we are on a CI system
*
* @default - `false` unless the environment variable `CI` is set
*/
readonly ci?: boolean;
/**
* Display mode for stack activity events
*
* The default in the CLI is StackActivityProgress.BAR. But since this is an API
* it makes more sense to set the default to StackActivityProgress.EVENTS
*
* @default StackActivityProgress.EVENTS
*/
readonly progress?: StackActivityProgress;
/**
* Maximum number of simultaneous deployments (dependency permitting) to execute.
*
* @default 1
*/
readonly concurrency?: number;
/**
* Whether to build/publish assets in parallel.
*
* @default false
*/
readonly assetParallelism?: boolean;
/**
* Whether to build all assets before deploying the first stack (useful for failing Docker builds)
*
* @default true
*/
readonly assetPrebuild?: boolean;
}
/**
* Supported display modes for stack deployment activity
*/
export enum StackActivityProgress {
/**
* Displays a progress bar with only the events for the resource currently being deployed
*/
BAR = 'bar',
/**
* Displays complete history with all CloudFormation stack events
*/
EVENTS = 'events',
}