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
{{ message }}
This repository was archived by the owner on Feb 14, 2023. It is now read-only.
Split your serverless.yaml config file into smaller modules and import them.
By using this plugin you can build your serverless config from smaller parts separated by functionalities.
Imported config is merged, so all keys are supported and lists are concatenated (without duplicates).
Works on importing yaml files by path or node module, especially useful in multi-package repositories.
And then add the plugin to your serverless.yml file:
plugins:
- serverless-import-config-plugin
Usage
Specify config files to import in custom.import list:
custom:
import:
- ./path/to/serverless.yml # path to YAML file with serverless config
- ./path/to/dir # directory where serverless.yml can be find
- module-name # node module where serverless.yml can be find
- '@myproject/users-api'# monorepo package with serverless.yml config file
- module-name/custom-serverless.yml # path to custom config file of a node module
custom.import can be also a string, when only one file needs to be imported:
custom:
import: '@myproject/users-api'
Relative paths
All function handler paths are automatically prefixed by the imported config directory.
functions:
postOrder:
handler: functions/postOrder.handler # relative to the imported config
For other fields you need to use ${dirname} variable manually.
${dirname} points to a directory of imported config file.