Understanding serverless.yml file, properties with simple explanation, variables in serverless.yml – Serverless Framework and aws
AWS , Cloud , Uncategorized / April 23, 2020

Serverles.yml Property Description service Will have the properties which describe the service for which the YAML file is for, properties like name, arn… app Name of the app you create service for. App should be created in serverless and name can be found in serverless.com dashboard org Multiple organizations can be created in serverless and this property indicates the organization for which the service is created package Include/Exclude files or folders in the deployment package. Example,to exclude git folder,node_modules.. provider This Will have the properties for the cloud service provider. Details like name(eg:AWS),runtime(eg:Node.js), region(eg:Ohio),and others like timeout,stage(dev,prod..) and memory custom Will have custom variables for services like base, params, role… functions Will have functions in the service. Functions can have name, handler, environment variables, description… resources We will have the resources used by the service, like DynamoDB tables, lambda… output Variable for refactoring. It can be used in other serverless.yml files. This Can be used along with different app/stage/region.Example: ${output:appname:stagename:regionname:my-service.var-key}         Variables in Serverless Variables can be used in YAML file in different ways, the orange highlighted text indicates the various¬† ways Variables are added using interpolation, variable values are referenced using ${}.     ${self:provider.stage} –…

Share this page in social media platforms