Custom domains are a great way to shorten the default API Gateway domain into something more readable. For example instead of https://sdrojbaf64.execute-api.us-east-2.amazonaws.com/
users could navigate to, for example, example.com
.
Before getting started ensure that you:
We’ll be referring to example.com
only as an example in the following steps. Use your domain when you see this.
Navigate to API Gateway Console > Custom domain names > Create
If you haven’t already created a certificate, you can do that through ACM by clicking “Create new certificate in Amazon Certificate Manager”. If you already have a cert, skip to Setup API Mappings.
On the Certificate Manager console, click “Request”
Enter in the domain you own, i.e. example.com
Select either email or DNS validation (I prefer email)
Click request
If you selected email, you’ll get an email to the email you have on file with the regisitrar. Click “I approve” to activate the certificate.
Return back to the API Gateway console, select the certificate and click “Create” to complete the setup.
Next on the API Gateway > Custom domain names > your domain
Click on Configure API Mappings and create a new one like:
You’ll see a section called API Gateway domain name. Copy that for DNS setup.
Create a DNS CNAME rule that points your domain to the API Gateway domain like so:
Rule | Source | Destination |
---|---|---|
CNAME | example.com | d-hb4qd1edp8.execute-api.us-east-2.amazonaws.com. |
Note: this is not the same as the URL you access when you go to PCM. Check API Gateway > Custom Domains > API Gateway domain name for the correct domain.
Navigate to the Cognito Console > Select your user pool
Under App Integration > Domain > Create custom domain
Enter in the same domain as before and select the certificate
Navigate to Cognito > App Integration > App clients and analytics. There you’ll see an application, click on it and scroll down to Hosted UI.
Edit the section and add in i.e. example.com/login
under the Allowed Callback URLs section:
Go to the Lambda Console (deeplink) and search for ParallelClusterUIFunction
Select the function then Configuration > Environment Variable. Edit SITE_URL
to point to the domain you setup:
example.com
and authenticate, you should now be connected to ParallelCluster UI using your own domain.