You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are developing locally and have different setups between developers, e.g. DB passwords, etc. which are stored in SSM and we are using the "SSM offline" plugin to help us with this.
In previous versions Serverless has showed a warning at run-time and/or deploy of missing variables in SSM "online" but from the next major an error will be thrown instead as when I tested with setting:
Set "variablesResolutionMode: 20210326" in your service config, to adapt to new behavior now
Today using the serverless-offline-ssm package we run it with a local stage which then reads the variables from a .env file or from the custom section in serverless.yml and this works fine now. However in v3.0.0 this will not work anymore as the SSM variables won't be available in AWS online and an error will be thrown.
I'd like to suggest to offer a possibility to bypass this check when running "offline" so that we can continue to use the serverless-offline-ssm package.
Any of the below would work IMO:
Not to enforce using variablesResolutionMode when running in offline, i.e. IS_OFFLINE: 'true'
Only check variablesResolutionMode at deploy and not when running locally
Add a flag, e.g. --variablesresolutionmode off to allow using SSM var's not in AWS
The text was updated successfully, but these errors were encountered:
Hello @QAnders, thanks a lot for reporting. The variablesResolutionMode is only temporary in v2 and that setting will be removed in v3 when we fully switch to the new variable resolver and drop support for the old one, so all the suggestions are not an option currently - the previous logic will be removed. After inspecting the serverless-offline-ssm plugin, it looks like it's "hacking" the Framework by overriding the ssm resolver - that is currently not possible, but will be after implementing #9311 - the plugin will have to be adjusted, but it should be able to work in a similar fashion. We'd be more than happy accept PR for implementing #9311
Thanks! I see... I don't fully understand how/what you are intending but I get the gist that we can continue using our local SSM var's (with some tweaks) so that is all I wanted to ensure!
Thanks for an awesome job and I'd love to help but TS stuff is not in my ballpark unfortunately... Too old for that modern stuff...
The extensions from #9311 do not have to specific to TS, but the idea came up from a TS-related use case. If we allow supporting such extensions, I believe that via such extension it will be possible to adjust the serverless-offline-ssm plugin/make it an extension that can override the ssm resolver.
Use case description
The planned change in v3.0.0 for
variablesResolutionMode
shouldn't be enforced for AWS SSM variablesProposed solution
When using Serverless Offline and SSM (which I believe is very common) there are a few solutions for using "offline" SSM, e.g. https://github.com/janders223/serverless-offline-ssm
We are developing locally and have different setups between developers, e.g. DB passwords, etc. which are stored in SSM and we are using the "SSM offline" plugin to help us with this.
In previous versions Serverless has showed a warning at run-time and/or deploy of missing variables in SSM "online" but from the next major an error will be thrown instead as when I tested with setting:
Set "variablesResolutionMode: 20210326" in your service config, to adapt to new behavior now
Today using the
serverless-offline-ssm
package we run it with alocal
stage which then reads the variables from a.env
file or from thecustom
section inserverless.yml
and this works fine now. However in v3.0.0 this will not work anymore as the SSM variables won't be available in AWS online and an error will be thrown.I'd like to suggest to offer a possibility to bypass this check when running "offline" so that we can continue to use the
serverless-offline-ssm
package.Any of the below would work IMO:
variablesResolutionMode
when running in offline, i.e.IS_OFFLINE: 'true'
variablesResolutionMode
at deploy and not when running locally--variablesresolutionmode off
to allow using SSM var's not in AWSThe text was updated successfully, but these errors were encountered: