serverless/lib/templates/serverless.yaml

50 lines
1.7 KiB
YAML

service: first_service
plugins:
- additional_plugin
- another_plugin
custom: # for plugin authors to collect custom config
default_providers: &default_providers
aws: # aws specific config
timeout: 6
memorySize: 1024
runtime: nodejs4.3
azure: # azure specific config
disabled: false
functions: # if this gets too big, you can always use JSON-REF
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
# http_endpoints:
# post: users/create
# schedule: rate(10 minutes)
azure:
http_endpoints:
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: # you can embed resources directly with the provider specific syntax
Resources:
azure:
$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