File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22const BbPromise = require ( 'bluebird' ) ;
33const deploy = require ( './lib/deploy' ) ;
4+ const remove = require ( './lib/remove' ) ;
45
56class ServerlessStepFunctions {
67 constructor ( serverless , options ) {
@@ -10,7 +11,8 @@ class ServerlessStepFunctions {
1011
1112 Object . assign (
1213 this ,
13- deploy
14+ deploy ,
15+ remove
1416 ) ;
1517
1618 this . commands = {
@@ -31,11 +33,30 @@ class ServerlessStepFunctions {
3133 } ,
3234 } ,
3335 } ,
36+ remove : {
37+ commands : {
38+ stepf : {
39+ usage : 'Remove Step functions' ,
40+ lifecycleEvents : [
41+ 'remove' ,
42+ ] ,
43+ options : {
44+ statemachine : {
45+ usage : 'Name of the State Machine' ,
46+ shortcut : 'sm' ,
47+ required : true ,
48+ } ,
49+ } ,
50+ } ,
51+ } ,
52+ } ,
3453 } ;
3554
3655 this . hooks = {
3756 'deploy:stepf:deploy' : ( ) => BbPromise . bind ( this )
3857 . then ( this . deploy ) ,
58+ 'remove:stepf:remove' : ( ) => BbPromise . bind ( this )
59+ . then ( this . remove ) ,
3960 } ;
4061 }
4162}
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+ const BbPromise = require ( 'bluebird' ) ;
3+
4+ module . exports = {
5+ remove ( ) {
6+ BbPromise . bind ( this )
7+ . then ( this . getStateMachineArn )
8+ . then ( this . deleteStateMachine ) ;
9+
10+ return BbPromise . resolve ( ) ;
11+ } ,
12+ } ;
You can’t perform that action at this time.
0 commit comments