-
Notifications
You must be signed in to change notification settings - Fork 71
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
Region found in serverless.yml is not getting variable expanded #17
Comments
@shentonfreude can you provide a simplified example that still demonstrates the break? Right now I'm trying to read through your example but you're referencing files that aren't included. Edit - Specifically the If you're convinced that's the problem then I'd also encourage you to throw in a PR for a fix and I'll test things on what's breaking for you now and apply/test the fix. |
OK @fernando-mc, I'll try to come up with a more simple example. I can take a whack at a fix but Node's not my strong suite. Hopefully later today. |
Sounds great. Thanks @shentonfreude! |
Sadly, I'm not node-smart enough to solve the problem but have created what I hope is a minimal full example that demonstrates the problem. I've put it up in a repo here: But for TL;DR, if I have:
I then see Finch not expanding the region in its message, then you'll notice
It doesn't help to use a more complex variable in provider.region to avoid a second lookup. |
@shentonfreude Thanks for providing that repo and the extra information here. I've tested it myself and confirmed the issue. I think you're correct and this is a bug in the plugin - the Serverless Framework itself appears to evaluate the code you're using correctly. (I was able to use basically the same file to create a dynamoDB table that correctly created with the correct name - in this case I'm not sure how soon I'll be able to patch and test this myself but I'll make it the next thing I work on related to this plugin. I definitely suggest trying to put a patch PR in for the issue for me to review as that will likely be a faster way to get it resolved. |
Thanks for confirming @fernando-mc. I'll take a look but I'm a python guy and my node chops aren't even good enough yet to know how to print something :-( If I can figure out why it's not resolving and come up with a fix, I'll post a PR for sure. |
This fix seems to solve the problem, but I'll admit to being a bit out of my depth.
|
@shentonfreude Great! I'll try to test the fix this weekend. |
…custom_variable Fix GH-17 variables do not get expanded
Fixed by #18 |
I'm deploying to different stages (shentonfreude, dev, test, prod) and each may have a different
region
defined in serverless.yml stage variables file custom_stage_variables.yml:Then the provider defines
region
, so that Finch can find it:But when I try to deploy the client, it looks like Finch is not expanding the region variable:
S3 is lying here, there's no resource conflict -- I think it just doesn't know what to do with "${self:custom.region}", since it's not expanding to "us-east-1" or "ap-southeast-2".
Am I using it wrong? or does Finch need to run the template interpolation over these variables, perhaps around here?
https://github.com/fernando-mc/serverless-finch/blob/master/index.js#L33
The text was updated successfully, but these errors were encountered: