I’m trying to write a simple serverless plugin. The main reason for this tool to exist as a plugin is so that I can make the serverless.yml serve as source of truth for some configuration data that needs to exist in some lambda’s as well as some other automation invoked by plugin.
How do I resolve the variable references in the serverless.yml from my plugin?
For example – i have a key in serverless.yml:
I also ran into this in serverless-python-requirements. Serverless changed it’s behavior a few releases ago. That variable substitution is not called by the time plugin constructors get called. Unless you actually need it then, just access it in your lifecycle hooks, it’ should be resolved by then.
This is the issue – and the fix!! Many thanks! It might be nice to explicitly call out in the documentation that variables aren’t resolved until after plugin creation has completed.