@@ -58,7 +58,7 @@ class ServerlessStepFunctionsLocal {
5858
5959 const bootstrap = ( async ( ) => {
6060 await this . startStepFunctions ( ) ;
61- await this . getStepFunctionsFromConfig ( ) ;
61+ await this . getStepFunctionsFromConfigurationInput ( ) ;
6262 await this . createEndpoints ( ) ;
6363 } ) ( )
6464
@@ -103,25 +103,16 @@ class ServerlessStepFunctionsLocal {
103103 return this . stepfunctionsServer . stop ( ) ;
104104 }
105105
106- async getStepFunctionsFromConfig ( ) {
107- const { servicePath} = this . serverless . config ;
106+ async getStepFunctionsFromConfigurationInput ( ) {
108107
109- if ( ! servicePath ) {
110- throw new Error ( 'service path not found' ) ;
111- }
112-
113- const configPath = path . join ( servicePath , 'serverless.yml' ) ;
114-
115- const preParsed = await this . serverless . yamlParser . parse ( configPath ) ;
116- const parsed = await this . serverless . variables . populateObject ( preParsed ) ;
108+ this . stateMachines = this . stateMachineCFARNResolver ( this . serverless . configurationInput . stepFunctions . stateMachines ) ;
117109
118- this . stateMachines = this . stateMachineCFARNResolver ( parsed . stepFunctions . stateMachines ) ;
119-
120- if ( parsed . custom
121- && parsed . custom . stepFunctionsLocal
122- && parsed . custom . stepFunctionsLocal . TaskResourceMapping ) {
123- this . replaceTaskResourceMappings ( parsed . stepFunctions . stateMachines , parsed . custom . stepFunctionsLocal . TaskResourceMapping ) ;
110+ if ( this . serverless . configurationInput . custom
111+ && this . serverless . configurationInput . custom . stepFunctionsLocal
112+ && this . serverless . configurationInput . custom . stepFunctionsLocal . TaskResourceMapping ) {
113+ this . replaceTaskResourceMappings ( this . serverless . configurationInput . stepFunctions . stateMachines , this . serverless . configurationInput . custom . stepFunctionsLocal . TaskResourceMapping ) ;
124114 }
115+
125116 }
126117
127118 /**
0 commit comments