Static URL for AWS::Serverless::Function

0

Every time I create aws lambda function I get different url with format https://<XXXXX>execute-api.<REGION>amazonaws.com 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>.azurewebsites.net/

Thanks

  • please accept the answer if it was useful

1 Answer
2

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.

https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html

https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-api.html#sam-api-domain

Note:

  • 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
EXPERT
answered 18 days ago
profile pictureAWS
EXPERT
iBehr
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