fix: Ensure CF stacks are deleted on failed creaton attempt (#7158)

Until now, failed stack deploys when using deploymentBucket to specify
an existing bucket were left in ROLLBACK_COMPLETE state.
This required manual 'sls remove' before a redeploy.

Fixes #6612, follow-up of incomplete fix in #5631
This commit is contained in:
coyoteecd 2020-01-07 14:19:39 +02:00 committed by Mariusz Nowak
parent a8739fe33b
commit 53a18cbff6
2 changed files with 2 additions and 2 deletions

View File

@ -24,7 +24,7 @@ module.exports = {
const params = {
StackName: stackName,
OnFailure: 'ROLLBACK',
OnFailure: 'DELETE',
Capabilities: ['CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM'],
Parameters: [],
TemplateURL: templateUrl,

View File

@ -51,7 +51,7 @@ describe('updateStack', () => {
expect(
createStackStub.calledWithExactly('CloudFormation', 'createStack', {
StackName: awsDeploy.provider.naming.getStackName(),
OnFailure: 'ROLLBACK',
OnFailure: 'DELETE',
Capabilities: ['CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM'],
Parameters: [],
TemplateURL: `https://s3.amazonaws.com/${awsDeploy.bucketName}/${awsDeploy.serverless.service.package.artifactDirectoryName}/${compiledTemplateFileName}`,