v2.0.0-alpha.0
Pre-release
Pre-release
Complete rewrite of the variable resolver. We use the amazing cfn-resolver-lib lib now. This allows us to support not only Ref and Fn::ImportValue as in previous releases, but we're able to resolve the most commonly used intrinsic functions automatically now.
Migrating from 1.x to 2.x
- Running
sls invoke localorsls offline startwill no longer create or update your.envfile. If you want to create an.envfile, simply runsls export-envinstead. - By default the plugin will no longer overwrite any existing
.envfile. To enable overwriting existing files either specific--overwritein the command line or set thecustom.export-env.overwriteconfiguration option. - Resource
Outputsvalues (resources.Resources.Outputs.*) are no longer exported automatically. This has always been a workaround and causes more problems than it actually solved. The plugin will try its best to resolveFn::GetAttand other references for you now, so there should be little need for the old behavior anymore. Add the desired value new environment variable toprovider.environmentinstead. - Running
sls export-envwill no longer merge the environment variables of all functions into a single.envfile. Instead pass the name of the desired function as--functionargument to the command line. If no function is specified, only global environment variables will be exported. - The configuration options
filenameandpathFromRoothave been merged tofilenamenow. You can specify relative paths infilenamenow such as./dist/.env. Make sure the target folder exists!