Static URL for AWS::Serverless::Function


Every time I create aws lambda function I get different url with format https://<XXXXX>execute-api.<REGION> The <XXXXX> is some random string generated

Is it possible to create const string from available strings for the <XXXXX> part so I could call a static URL The same as done in Azure https://<CONST_STRING>


  • please accept the answer if it was useful

1 Answer

To create a consistent and static URL for your AWS Lambda function, you need to set up a custom domain name in Amazon API Gateway. This will allow you to create a custom URL for your API endpoints, ensuring that the URL remains constant and is not subject to the random string generated by AWS.


  • Make sure you have ownership of the domain name and have it verified in ACM.
  • The custom domain setup might take some time to propagate through DNS.
profile picture
answered 18 days ago
profile pictureAWS
reviewed 18 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions