Local provider enabling and lazy provider loading
From now on, setting a provider is done by specifying config.providerPackage
, rather than the old config.provider
.
In this new way, instead of import
ing the Provider object and assigning it in the config.provider
field, you simply specify the name of the package as a string:
// Old way – Now deprecated
import * as AWS from '@boostercloud/framework-provider-aws'
Booster.configure(environment.name, (config: BoosterConfig) => {
config.appName = 'my-cool-app'
config.provider = AWSProvider()
})
// New way
Booster.configure(environment.name, (config: BoosterConfig) => {
config.appName = 'my-cool-app'
config.providerPackage = '@boostercloud/framework-provider-aws'
// New optional field for specifying rockets
config.rockets = [/* your rockets here */]
})
With this addition, now Booster provider libraries are loaded on runtime when they are needed, meaning that if you want to deploy the same application to different providers (e.g. AWS, and Azure) you won't get any runtime errors complaining that the SDK for the cloud provider is missing.