Serverless YAML extension parser
This tiny library will parse YAML extensions used in serverless framework.
Supported extensions
Include external file
This extension will include content of external yaml files.
version : 1
env: dev
config: ${file(./common.yml)}
endpoint: http://service-url
version : 1
env: dev
config:
endpoint: http://service-url
Inject environment variable
This extension will inject envronment values
- config.yml
export NODE_ENV = development
version : 1
env: ${env:NODE_ENV}
version : 1
env: development
Inject global variables
This extension will inject variable from global scope.
version : 1
env: stage
config: ${file(./common.yml)}
endpoint: http://service-${global:env}
version : 1
env: stage
config:
endpoint: http://service-stage
Inject local variables
This extension will inject variable from local scope.
version : 1
env: stage
config: ${file(./common.yml)}
port: 8080
endpoint: http://service:${self:port}
version : 1
env: stage
config:
port: 8080
endpoint: http://service:8080