aws-architect 6.7.77 → 6.7.78
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.
- package/lib/CloudFormationDeployer.js +14 -20
- package/package.json +1 -1
|
@@ -121,7 +121,7 @@ class CloudFormationDeployer {
|
|
|
121
121
|
throw { error: 'Current status of the stack has failed', status: stackStatus };
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
if (!allowUpdateRollback && stackStatus === 'UPDATE_ROLLBACK_COMPLETE') {
|
|
124
|
+
if (!allowUpdateRollback && stackStatus === 'UPDATE_ROLLBACK_COMPLETE' || stackStatus === 'ROLLBACK_COMPLETE') {
|
|
125
125
|
const eventsResponse = await this.cloudFormationClient.describeStackEvents({ StackName: stackName }).promise();
|
|
126
126
|
const failureStackEventStatuses = {
|
|
127
127
|
CREATE_FAILED: true,
|
|
@@ -144,10 +144,6 @@ class CloudFormationDeployer {
|
|
|
144
144
|
return iteratePromise();
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
if (stackStatus === 'ROLLBACK_COMPLETE') {
|
|
148
|
-
throw { error: 'Failed to create stack, it must be deleted manually.', status: stackStatus };
|
|
149
|
-
}
|
|
150
|
-
|
|
151
147
|
if (stackStatus.match(/COMPLETE$/i)) {
|
|
152
148
|
return true;
|
|
153
149
|
}
|
|
@@ -269,22 +265,7 @@ class CloudFormationDeployer {
|
|
|
269
265
|
await this.cloudFormationClient.createChangeSet(stackParameters).promise();
|
|
270
266
|
await this.waitForChangeSetCreation(options.stackName, options.changeSetName);
|
|
271
267
|
await this.cloudFormationClient.executeChangeSet(executeParameters).promise();
|
|
272
|
-
await this.waitForCompletion(options.stackName, false);
|
|
273
|
-
let stackData = await this.cloudFormationClient.describeStacks({ StackName: options.stackName }).promise();
|
|
274
|
-
// make options default to protect the stack
|
|
275
|
-
if (options.automaticallyProtectStack !== false) {
|
|
276
|
-
try {
|
|
277
|
-
await this.cloudFormationClient.updateTerminationProtection({ EnableTerminationProtection: true, StackName: options.stackName }).promise();
|
|
278
|
-
} catch (error) {
|
|
279
|
-
console.log('Failed to update termination protection', error);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
return stackData.Stacks[0];
|
|
284
268
|
} catch (error) {
|
|
285
|
-
if (error.code === 'UPDATE_ROLLBACK_COMPLETE') {
|
|
286
|
-
throw error;
|
|
287
|
-
}
|
|
288
269
|
if (error.code === 'ValidationError' || error.code === 'MultipleValidationErrors' || error.code === 'InvalidParameterType') {
|
|
289
270
|
throw error;
|
|
290
271
|
}
|
|
@@ -307,6 +288,19 @@ class CloudFormationDeployer {
|
|
|
307
288
|
const stackData = await this.cloudFormationClient.describeStacks({ StackName: options.stackName }).promise();
|
|
308
289
|
return Object.assign({ title: 'Change set skipped, no changes detected.', code: 'SKIPPED' }, stackData.Stacks[0]);
|
|
309
290
|
}
|
|
291
|
+
|
|
292
|
+
await this.waitForCompletion(options.stackName, false);
|
|
293
|
+
let stackData = await this.cloudFormationClient.describeStacks({ StackName: options.stackName }).promise();
|
|
294
|
+
// make options default to protect the stack
|
|
295
|
+
if (options.automaticallyProtectStack !== false) {
|
|
296
|
+
try {
|
|
297
|
+
await this.cloudFormationClient.updateTerminationProtection({ EnableTerminationProtection: true, StackName: options.stackName }).promise();
|
|
298
|
+
} catch (error) {
|
|
299
|
+
console.log('Failed to update termination protection', error);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
return stackData.Stacks[0];
|
|
310
304
|
}
|
|
311
305
|
|
|
312
306
|
async stackSetExists(stackSetName) {
|