DEV Community

Cheedge Lee
Cheedge Lee

Posted on • Originally published at notes-renovation.hashnode.dev

Setting Up Custom Domain for API Gateway & CloudFront

During migrating one local host website to AWS, there are many point I need to write donw. Each article will be a short note, just keep as simple as possible to record the working steps, which makes it later can be quickly found, and also with a simple description. Therefore this serie will not be a detailed explain articles.

Preparing certificate

First we need the SSL/TLS cert, and how to apply it on AWS ACM can be found here.

CloudFront

API Gateway

  1. In API Gateway console click the custom domain names, add a domain name.
  2. Fill in the domain (subdomain) name same as the domain name in the certificate you apply before.
  3. Refresh the ACM certificate, and choose the one used for the domain name you filled in before, and add.
    • it will provide a API Gateway domain name, which used in next step, copy it.
  4. Next, go to the Domain Dashboard where you register your domain (eg. cloudflare), and create a new CNAME record.
    • The name for this record is your domain(subdomain).
    • the Target should be above copied new generated API Gateway domain name.
    • (option) in cloudflare make sure that SSL encryption Mode be Full or Full(strict)
  5. API Gateway Mapping.
    • under the Custom domain names -> your created domain name -> config API Gateway Mapping.
    • Select the API and the Stage. for me, it's BackendAPI and prod Stage. Then when I use this domain, I can not add prod as a path after the domain.

Billboard image

Deploy and scale your apps on AWS and GCP with a world class developer experience

Coherence makes it easy to set up and maintain cloud infrastructure. Harness the extensibility, compliance and cost efficiency of the cloud.

Learn more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay