mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
28 lines
605 B
JavaScript
28 lines
605 B
JavaScript
'use strict';
|
|
|
|
const BbPromise = require('bluebird');
|
|
|
|
module.exports = {
|
|
async remove() {
|
|
const stackName = this.provider.naming.getStackName();
|
|
const params = {
|
|
StackName: stackName,
|
|
};
|
|
|
|
const customDeploymentRole = this.provider.getCustomDeploymentRole();
|
|
if (customDeploymentRole) {
|
|
params.RoleARN = customDeploymentRole;
|
|
}
|
|
|
|
const cfData = {
|
|
StackId: stackName,
|
|
};
|
|
|
|
return this.provider.request('CloudFormation', 'deleteStack', params).then(() => cfData);
|
|
},
|
|
|
|
async removeStack() {
|
|
return BbPromise.bind(this).then(this.remove);
|
|
},
|
|
};
|