Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add variable interpolation and env vars #9

Merged
merged 1 commit into from
Feb 13, 2018
Merged

add variable interpolation and env vars #9

merged 1 commit into from
Feb 13, 2018

Conversation

ajagnanan
Copy link
Contributor

@ajagnanan ajagnanan commented Feb 7, 2018

I ran into the issue where variables weren't interpolated when parsing the yaml file. I took the parser that's used here https://github.com/horike37/serverless-step-functions/blob/11134c93e1f705ef5ccc4127543d6f4bad959fc8/lib/yamlParser.js. I also added environment variable processing.

@ajagnanan
Copy link
Contributor Author

could you add the eslint configuration file? I can fix those lint errors tomorrow most likely.

@vkkis93
Copy link
Owner

vkkis93 commented Feb 11, 2018

Hi @ajagnanan
You are right I missed that.
Concerning your pull request, this code from https://github.com/horike37/serverless-step-functions/blob/11134c93e1f705ef5ccc4127543d6f4bad959fc8/lib/yamlParser.js is unnecessary for my package.
My code works in a little bit different way.

I'm working on the version 2.
This release will include fix about env variables.
I have added lines which loads env variables like:
const environment = this.serverless.service.provider.environment;
process.env = _.extend(process.env, environment);
I hope it will be released this week.

I will close this pull request.
Is it ok for you ?
P.S Thank you for contribution

@ajagnanan
Copy link
Contributor Author

ajagnanan commented Feb 11, 2018

gotcha, just an fyi for what I'm doing. Cloudformation has a max size limit that we usually run into. To overcome it, we usually separate the serverless file into 'stacks'. In this case I'm using variables to reference the stateMachine defs in another file like so:

stepFunctions:
  stateMachines: ${file(stack.${opt:stack}.yaml):stepFunctions.stateMachines}

_findState wasn't finding my stateMachines because the plugin wasn't interpolating which is why I added this pr.

@vkkis93
Copy link
Owner

vkkis93 commented Feb 12, 2018

It's great that you said about it
I will look on it.

@vkkis93 vkkis93 merged commit 1cb826e into vkkis93:master Feb 13, 2018
@vkkis93
Copy link
Owner

vkkis93 commented Feb 13, 2018

Thank you for your PR @ajagnanan .
Works great.
Version 1.0.1 includes this fix.

@vkkis93 vkkis93 added the bug label Feb 13, 2018
@vkkis93 vkkis93 added this to the v1.0.1 milestone Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants