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

Custom variables not expanding #104

Open
tiagomjorge opened this issue Aug 8, 2021 · 1 comment
Open

Custom variables not expanding #104

tiagomjorge opened this issue Aug 8, 2021 · 1 comment

Comments

@tiagomjorge
Copy link

I'm trying to configure the plugin's custom variables like this:

custom:
  rust:
    dockerTag: my-tag
    dockerImage: my-image
    dockerPath: ${env:DOCKER_PATH}

However, I've noticed that the dockerPath is getting passed to the plugin non-expanded. Looking at the plugin's code, it seems like since the plugin is consuming all of the configuration parameters on its constructor, it is reading the values before the serverless framework expands them. I've also tried using a file, like:

custom:
  rust:
    ${file(serverless/includes/serverless-rust.yml)}

But it also doesn't work, which makes sense, since the plugin is reading the config parameters before the serverless framework has a chance to fill them in. One fix would be to read those variables inside the hooked up functions, instead of inside the constructor.

Does this make sense? Am I missing something?

@tiagomjorge
Copy link
Author

Just found this on the serverless framework plugin doc, which confirms my theory:

Note: Variable references in the serverless instance are not resolved before a Plugin's constructor is called, so if you need these, make sure to wait to access those from your hooks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant