aws-architect 6.7.134 → 6.7.136
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -13,6 +13,17 @@ function tryParseJson(stringContent) {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
function getChangeSetName(changeSetName) {
|
|
17
|
+
let newChangeSetName = '';
|
|
18
|
+
if (!changeSetName[0].match(/[a-z]/ig)) {
|
|
19
|
+
newChangeSetName = 'v';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
newChangeSetName += changeSetName.replace(/[^a-z0-9-]/gi, '-');
|
|
23
|
+
|
|
24
|
+
return newChangeSetName;
|
|
25
|
+
}
|
|
26
|
+
|
|
16
27
|
class CloudFormationDeployer {
|
|
17
28
|
constructor(region, bucketManager, deploymentBucket) {
|
|
18
29
|
this.cloudFormationClient = new CloudFormation({ region });
|
|
@@ -159,7 +170,9 @@ class CloudFormationDeployer {
|
|
|
159
170
|
await iteratePromise();
|
|
160
171
|
}
|
|
161
172
|
|
|
162
|
-
async waitForChangeSetCreation(stackName,
|
|
173
|
+
async waitForChangeSetCreation(stackName, rawChangeSetName) {
|
|
174
|
+
const changeSetName = getChangeSetName(rawChangeSetName);
|
|
175
|
+
|
|
163
176
|
let timeout = new Date();
|
|
164
177
|
let timeoutLength = 60 * 1000;
|
|
165
178
|
timeout.setTime(timeout.getTime() + timeoutLength);
|
|
@@ -213,9 +226,11 @@ class CloudFormationDeployer {
|
|
|
213
226
|
let region = this.cloudFormationClient.config.region;
|
|
214
227
|
console.log(`Starting Configuration of Stack: ${options.stackName} in ${region}`);
|
|
215
228
|
|
|
229
|
+
const changeSetName = getChangeSetName(options.changeSetName);
|
|
230
|
+
|
|
216
231
|
let stackExists = await this.stackExists(options.stackName);
|
|
217
232
|
let stackParameters = {
|
|
218
|
-
ChangeSetName:
|
|
233
|
+
ChangeSetName: changeSetName,
|
|
219
234
|
StackName: options.stackName,
|
|
220
235
|
Capabilities: ['CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM'],
|
|
221
236
|
ChangeSetType: stackExists ? 'UPDATE' : 'CREATE',
|
|
@@ -258,7 +273,7 @@ class CloudFormationDeployer {
|
|
|
258
273
|
}
|
|
259
274
|
|
|
260
275
|
let executeParameters = {
|
|
261
|
-
ChangeSetName: stackParameters.ChangeSetName,
|
|
276
|
+
ChangeSetName: getChangeSetName(stackParameters.ChangeSetName),
|
|
262
277
|
StackName: options.stackName
|
|
263
278
|
};
|
|
264
279
|
|
|
@@ -393,7 +408,7 @@ class CloudFormationDeployer {
|
|
|
393
408
|
}
|
|
394
409
|
}
|
|
395
410
|
|
|
396
|
-
const changeSetName = options.changeSetName
|
|
411
|
+
const changeSetName = getChangeSetName(options.changeSetName);
|
|
397
412
|
if (stackExists) {
|
|
398
413
|
console.log('Updating stack set...');
|
|
399
414
|
stackParameters.OperationId = `${changeSetName}-update`;
|
|
@@ -506,8 +521,7 @@ class CloudFormationDeployer {
|
|
|
506
521
|
}
|
|
507
522
|
}
|
|
508
523
|
|
|
509
|
-
const changeSetName = options.changeSetName
|
|
510
|
-
|
|
524
|
+
const changeSetName = getChangeSetName(options.changeSetName);
|
|
511
525
|
if (stackExists) {
|
|
512
526
|
console.log('Updating organizational stack set, stack will be updated asynchronously');
|
|
513
527
|
stackParameters.OperationId = `${changeSetName}-update`;
|