Inherit YAML changes for serverless
npm install serverless-yamlUtility for extending serverless yml based on common components from dependencies.
Create files that are useful in a "serverless" subdirectory in a dependency or in the top level package with names that point to the path within the serverless object you want to update, like:
- provider.environment.yml - a map of environment variables to be added to provider.envrionment for common usage
- Resources.mainRole.Properties.Policies.yml - a list of policies to add to the the roles called mainRole.
Supports yaml encoding (detected by .yml or .yaml extension) and JSON (.json)
bash
npx serverless-yaml [options]
`
Update serverless yml based on partials in depedencies
Options
* -y --yaml-file \<path> Serverless yml file to inspect (default: ./serverless.yml)
* -o --output \<path> Output file (default is same as input serverless file)
* -w --working-path \<path> Working path for node project (default: .)
serverless-yaml - v1.0.0
Index
$3
* apply
* getAllDependencies
* inspectDependency
Functions
$3
▸ apply(
source: object, key: string, objOrArray: object | any[]): undefined | objectDefined in index.ts:30
Parameters:
Name | Type |
------ | ------ |
source | object |
key | string |
objOrArray | object | any[] |Returns: undefined | object
___
$3
▸ getAllDependencies(
path: string): [string, string][]Defined in bin.ts:9
Parameters:
Name | Type | Default |
------ | ------ | ------ |
path | string | process.cwd() |Returns: [string, string][]
___
$3
▸ inspectDependency(
path: string): objectDefined in index.ts:5
Parameters:
Name | Type |
------ | ------ |
path` | string |Returns: object
key? : undefined | string*
value? : any[] | object*