Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
553 views
in Technique[技术] by (71.8m points)

amazon web services - configure base domain url (site.com without www for example) to api gateway, and make it work from within the browser

I'm trying to create the shortest URL for unsubscribing messages. It should look like -

site.com/f3v4g1

This should result in calling an AWS Lambda function through AWS API Gateway. For that to happen, I need to set an A record in the DNS (in my case GoDaddy) and point to the API Gateway. The API Gateway has a custom domain name configured pointing to xxxnxxx.cloudfront.net.

Problem is that the A record requires a static IP.

Another try I did, with GoDaddy Forwarding option, but that will also not work, as it forwards the request to xxxnxxx.cloudfront.net, and it fails with a forbidden error, probably because the host is incorrect (it is expected to be executed from site.com).

Any idea how it can be done? Any simple AWS solution for that - that doesn't require a server with a static IP ;).

Thanks


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Move your DNS authoritative servers to Route 53, then use an ALIAS record there.

Only Route53 can properly resolve apex domain records in this way.

You can retain GoDaddy as your registrar if required. But assign the AWS DNS servers to the custom domain NS records in GoDaddy manage domains.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
...