Skip to content

Local provider enabling and lazy provider loading

Compare
Choose a tag to compare
@NickSeagull NickSeagull released this 07 Jul 13:10
· 1034 commits to main since this release

From now on, setting a provider is done by specifying config.providerPackage, rather than the old config.provider.
In this new way, instead of importing 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.