2017-01-25 19:26:29 +09:00

34 lines
711 B
JavaScript

'use strict';
const BbPromise = require('bluebird');
module.exports = {
remove() {
this.serverless.cli.log('Removing Stack...');
const stackName = `${this.serverless.service.service}-${this.options.stage}`;
const params = {
StackName: stackName,
};
if (this.serverless.service.provider.cfnRole) {
params.RoleARN = this.serverless.service.provider.cfnRole;
}
const cfData = {
StackId: stackName,
};
return this.provider.request('CloudFormation',
'deleteStack',
params,
this.options.stage,
this.options.region)
.then(() => cfData);
},
removeStack() {
return BbPromise.bind(this)
.then(this.remove);
},
};