3
votes

I've created couple of AWS Lambda functions which are invoked via API Gateway Proxy request. Note that I am using Serverless framework for deployment. Also, I am using AWS SAM for testing lambda functions locally.

Once I've deployed my lambda function, its API endpoint looks something like this: https://38sp8vme5j.execute-api.us-east-1.amazonaws.com/{STAGE}/{PATH}

I would like to know if there is a way to change 38sp8vme5j.execute-api this part of my API endpoint.

Thanks in advance

2

2 Answers

2
votes

In the API Gateway area, you have a option in the left menu called Custom Domain Names where you can set a specific domain you already have and set an alias to the specific Lambda function you want to run.

The Route 53 service is not necessary, you only need to register the domain in the certificates area ACM to have it available in this custom domain names option in API Gateway

1
votes

You may not be able to change the portion 38sp8vme5j.execute-api of your full domain name but you can surely add a new Alias DNS records in Route53 to use a different domain that you own.

There is an alternative and easier way to give custom domain names in the API gateway itself using the "Custom Domain Names" option as shown here.

enter image description here

Just fill in the details and provide an ACM certificate for HTTPs.