serverless: Resolver does not reload variable meta
Are you certain it’s a bug?
- Yes, it looks like a bug
Is the issue caused by a plugin?
- It is not a plugin issue
Are you using the latest version?
- Yes, I’m using the latest version
Is there an existing issue for this?
- I have searched existing issues, it hasn’t been reported yet
Issue description
If a plugin changes or adds contents of the configuration (serverless.service) the variables are not resolved as the variablesMeta is just created at start.
The problem can be solved by just running and merging variablesMeta before the last resolveVariables-call.
scripts/serverless.js

Service configuration (serverless.yml) content
N/A
Command name and used flags
serverless package
Command output
N/A
Environment information
Framework Core: 3.16.0 (local)
Plugin: 6.2.2
SDK: 4.3.2
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 32 (32 by maintainers)
I’m already done. This works flawlessly. Didn’t expect it to be that easy. Now i’ll need to add some tests as well.
@icholy great to hear that!
Hints on how to achieve that:
variablesMetatoServerlessclassserverless.extendConfiguration(configurationPathKeys, value)which should:configurationwithvalueat givenconfigurationPathKeyslib/configuration/variables/parseand extendvariablesMetawith it (taking into accountconfigurationPathKeys) also remove any eventual existing meta atconfigurationPathKeysserverless.extendConfigurationthrows error if invoked afterpluginManager.loadAllPluginsis run.