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?
Added to that if you need to completely re-deploy your stack your API urls will change.
By default, Serverless creates automatically an API Gateway for each Serverless stack or service (i.e. serverless. yml ) you deploy.
A Lambda integration maps a path and HTTP method combination to a Lambda function. You can configure API Gateway to pass the body of the HTTP request as-is (custom integration), or to encapsulate the request body in a document that includes all of the request information including headers, resource, path, and method.
Copy your API's invoke URL, and enter it in a web browser. Append the name of your Lambda function to your invoke URL to call your Lambda function. By default, the API Gateway console creates a route with the same name as your Lambda function, my-function . The full URL should look like https:// abcdef123 .
The URL of your API Gateway Endpoint will change when you recreate the CloudFormation for your service.
This can happen when:
You remove the stack (sls remove
) and recreate it (sls deploy
).
You rename your service name in your serverless.yml
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With