【问题标题】:Deploying multiple AWS Lambda functions部署多个 AWS Lambda 函数
【发布时间】:2023-03-09 07:45:02
【问题描述】:

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

【问题讨论】:

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


    【解决方案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
    

    【讨论】:

      猜你喜欢
      • 2019-01-13
      • 1970-01-01
      • 1970-01-01
      • 2019-04-15
      • 2023-02-02
      • 2019-08-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-07
      相关资源
      最近更新 更多