Serverless-framework, when does the API Gateway URL change?
S

1

10

I am using serverless-framework to deploy a lambda with http endpoints on AWS. This works fine and returns a API Gateway endpoint.

I wanted to know under what scenarios does the endpoint URL change. I need the URL to be constant, know deleting and redeploying the service will change the URL.

In what other cases does the URL change?

Siobhan answered 21/5, 2019 at 7:55 Comment(0)
M
15

The URL of your API Gateway Endpoint will change when you recreate the CloudFormation for your service.

This can happen when:

  1. You remove the stack (sls remove) and recreate it (sls deploy).

  2. You rename your service name in your serverless.yml.

    • In this case, your old API Gateway endpoint will still be there and will keep hosting the last version of the code that you deployed using the old service name and you'll have a new API Gateway endpoint that will point to your updated Lambdas.
Marysa answered 21/5, 2019 at 10:40 Comment(2)
Thanks for the answer. I assumed the same , service name and re-deploy. Is there a doc link for this.Siobhan
@Siobhan I am not aware of any documentation for that. But that's how CloudFormation behaves when you change the stack name and serverless deploy uses CloudFormation behind-the-scenes.Marysa

© 2022 - 2024 — McMap. All rights reserved.