部署多个AWS Lambda函数

时间:2019-05-12 11:29:38

标签: amazon-web-services aws-lambda serverless-framework

如果我有多个AWS Lambda函数,是否可以在一个YML文件中为所有三个函数指定部署配置,还是我需要为每个Lambda函数编写特定的YML文件?

1 个答案:

答案 0 :(得分:1)

是的-您可以在同一个无服务器框架服务定义中具有多个功能。

例如(您可以在documentation中查看更多信息):

service: myService

provider:
  name: aws
  runtime: nodejs6.10

functions:
  functionOne:
    handler: handler.functionOne
    description: optional description for your Lambda
    events: # All events associated with this function
      - http:
          path: users/create
          method: post
  functionTwo:
    handler: handler.functionTwo
    events:
      - s3: photos
  functionThree:
    handler: handler.functionThree
    memorySize: 512 # function specific
相关问题