-
Notifications
You must be signed in to change notification settings - Fork 112
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
${param}
variables are not resolved in constructs
#29
Comments
Hey @pedrodim, thanks for the report. This is indeed something that we need to clarify: because of the way Serverless loads all the plugins and resolves variables, this leads to some circular dependencies with constructs. Using the I'll investigate right away if we can solve this specifically. If we can't, I'll document the limitation. |
Thank you so much! An idea could be have each construct expose a initialize hook (like they do currently with From what I've seem on serverless/serverless#3911 other plugins have solved this by moving any logic that uses variables to a hook, maybe it is something that cannot be possible for all actual constructs but for some this could be a workaround. |
In the example above, The reason (I suspect) is related to the order in which variables are resolved. I'm still digging into it, I may have a lead. |
I am working on #31 that should fix this issue. |
${param}
variables are not resolved in constructs
I just spent several hours trying to understand why the parameters from the serverless dashboard weren't correctly being passed to lift plugin until I came across this note on the serverless plugins' guide.
Which means that trying to do the following will result in an error "ARNs must start with "arn:" and have at least 6 components: ${param:CERTIFICATE}".
I fixed it on a fork moving the Constructs loader to the initialize hook pedrodim@1c47638, which seems to work fine for the Static website construct (it does correctly deploy my website without errors) but obviously now some tests are broken and I have no idea how to fix those.
The text was updated successfully, but these errors were encountered: