如何命名无服务器AWS Lambda而不包含阶段名称?

时间:2019-07-16 21:04:46

标签: node.js aws-lambda serverless

我的lambda名称显示为device-service-dev-functionOne

我的serverless.yml如下:

service: device-service

    provider:
      name: aws
      runtime: nodejs10.x
      region: us-east-2
      logs:
        restApi: true
    functions:
      functionOne:
        handler: src/function-one.handler


    plugins:
      - serverless-pseudo-parameters
      - serverless-offline
      - serverless-plugin-typescript

如何防止开发人员被包含在device-service-dev-functionOne中?

1 个答案:

答案 0 :(得分:2)

您可以在函数定义中指定名称,例如name: my-function覆盖默认名称。

service: device-service

provider:
  name: aws
  runtime: nodejs10.x
  region: us-east-2
  logs:
    restApi: true
functions:
  functionOne:
    name: my-function
    handler: src/function-one.handler


plugins:
  - serverless-pseudo-parameters
  - serverless-offline
  - serverless-plugin-typescript