使用无服务器框架时更改API网关名称

时间:2020-07-19 01:04:09

标签: serverless-framework aws-serverless

无服务器框架使开发人员很容易创建连接到lambda函数的API网关。像这样

hello:
  name: hello-handler
  description: blablabla
  handler: /lambda-functions/hello-handler.handler
  role: HelloRole
  package:
    include:
      - lambda-functions/hello-handler.js
  events:
    - http: GET hello

我的问题是如何更改将要创建的API网关的名称?

1 个答案:

答案 0 :(得分:2)

基于doc,这应该可以解决问题。

provider:
  ...
  apiName: custom-api-name # Use a custom name for the API Gateway API