File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,16 @@ class ServerlessStepFunctionsLocal {
1313 this . log = serverless . cli . log . bind ( serverless . cli ) ;
1414 this . config = ( this . service . custom && this . service . custom . stepFunctionsLocal ) || { } ;
1515
16+ if ( this . service . stage !== undefined ) {
17+ this . stage = this . service . stage ;
18+ } else if ( this . service . provider !== undefined && this . service . provider . stage !== undefined ) {
19+ this . stage = this . service . provider . stage ;
20+ } else {
21+ this . stage = 'dev' ;
22+ }
23+
1624 // Check config
17- if ( ! this . config . accountId ) {
25+ if ( this . config . accountId === undefined ) {
1826 throw new Error ( 'Step Functions Local: missing accountId' ) ;
1927 }
2028
@@ -214,7 +222,7 @@ class ServerlessStepFunctionsLocal {
214222 switch ( state . Type ) {
215223 case 'Task' :
216224 if ( state . Resource && state . Resource [ 'Fn::GetAtt' ] && Array . isArray ( state . Resource [ 'Fn::GetAtt' ] ) ) {
217- state . Resource = `arn:aws:lambda:${ this . config . region } :${ this . config . accountId } :function:${ this . service . service } -${ this . serverless . stage ? this . serverless . stage : 'dev' } -${ state . Resource [ 'Fn::GetAtt' ] [ 0 ] } `
225+ state . Resource = `arn:aws:lambda:${ this . config . region } :${ this . config . accountId } :function:${ this . service . service } -${ this . stage } -${ state . Resource [ 'Fn::GetAtt' ] [ 0 ] } `
218226 }
219227 break ;
220228 case 'Map' :
You can’t perform that action at this time.
0 commit comments