serverless/lib/templates/serverless.yaml
2016-05-27 13:00:12 +02:00

48 lines
2.0 KiB
YAML

service: first_service
plugins:
- additional_plugin
- another_plugin
custom: # for plugin authors to collect custom config
default_providers: &default_providers
aws_lambda: # aws specific config
timeout: 6
memorySize: 1024
azure_functions: # azure specific config
disabled: false
functions: # if this gets too big, you can always use JSON-REF
name_template: ${stage}-${service}-${name} # "name" references the function name, service the whole service name
hello:
name_template: ${stage}-${service}-${name} # "name" references the function name, service the whole service name
handler: handler.hello
# only the following paths will be included in the resulting artefact uploaded to Lambda. Without specific include everything in the current folder will be included
include:
- lib
- functions
# The following paths will be excluded from the resulting artefact. If both include and exclude are defined we first apply the include, then the exclude so files are guaranteed to be excluded.
exclude:
- tmp
- .git
provider:
<<: *default_providers
events:
- aws_s3: first_bucket
- aws_http_endpoint:
post: users/create
- aws_scheduled: 5 * * * *
- azure_http_endpoint:
direction: in
name: req
resources:
aws_name_template: ${stage}-${service}-${name} # "name" references the resource name, service the whole service name
azure_name_template: # Resource naming template for Azure functions
aws_lambda: # you can embed resources directly with the provider specific syntax
AWSTemplateFormatVersion: 2010-09-09
Description: CloudFormation Resources
Resources:
azure_functions:
$ref: ../azure_resources.json # you can use JSON-REF to ref other JSON files
google:
$ref: ../google_resources.yaml # you can use JSON-REF to ref other YAML files