Serverless YAML extension parser
This tiny library will parse YAML extensions used in serverless framework.
Supported extensions
* - New extension not present in serverless yaml
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
Inject current git branch
This extension will inject current git branch name
branch: ${git:branch}
Inject last git commit hash
This extension will inject last git commit hash
image.tag: ${git:sha1}