codetheweb / serverless-step-functions-local

Run AWS step functions offline with Serverless
MIT License
16 stars 17 forks source link

Custom region config are not taking place #1

Closed wesklei closed 3 years ago

wesklei commented 3 years ago

Hi!

First, thanks for this repo! Have been using for a while and saved me a lot of time 😄

I just had an issue when tried to run on a different region from default. I setup the new region in the serverless.yml with 'us-east-2' but it remains using the default 'us-east-1'. I'm not familiar with the lib code, but it appears like step-function-localhost needs to receive the region in the start() method, not in the class constructor.

I have here a fork to demonstrate https://github.com/wesklei/serverless-step-functions-local/commit/ac6ed21608493e721a63ffb2e524f6a2d193ccb0

I would appreciate to merge a PR with this, or something else that fix the region issue. Can you take a look when you have a moment and see if that makes sense?

Thanks!

codetheweb commented 3 years ago

Sorry about that; pretty stupid mistake to make. 😅

Just published v0.1.4 with the fix, please let me know if that works.

AdamJHall commented 3 years ago

Hi,

It looks like you need as part of the constructor for AWS.StepFunctions as well otherwise it fails with: ConfigError: Missing region in config when attempting to create the state machine as well.

e.g.

    this.stepfunctionsAPI = new AWS.StepFunctions({endpoint: 'http://localhost:8083', region: this.config.region });
codetheweb commented 3 years ago

Yep, you're right.

Sorry I didn't catch that, haven't used this in a while and I don't feel like adding tests at this point. 😛

Happy to transfer the repo if someone else wants to take over maintenance.

Please try v0.1.5 and see if that works.

codetheweb commented 3 years ago

Going to assume it works at this point, feel free to reopen if you're still having issues.