6

The Serverless framework has made it very easy for developers to create an API gateway connected to a lambda function. like this

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

My question is how can I change the name of the API gateway that is going to be created?

joe
  • 128
  • 9

1 Answers1

11

Based on the doc, this should do the trick.

provider:
  ...
  apiName: custom-api-name # Use a custom name for the API Gateway API
jellycsc
  • 10,904
  • 2
  • 15
  • 32
  • Thanks! I should look harder next time lol... I was looking only at the [API docs](https://www.serverless.com/framework/docs/providers/aws/events/apigateway/) and elsewhere... – joe Jul 20 '20 at 02:18