Custom Domain: CloudFront
The following information is intended for our partners who are looking to configure your app for use with a Custom Domain url and want to use Amazon CloudFront.
Step 1 - Add Custom Domain in IoT Console
In this step we will let myDevices know that your App can be accessed from a Custom Domain URL. This is done by adding the URL to use in the IoT Console.
Log into the IoT Console using your credentials.
Navigate to the White Label Settings tab.
On the Product Info tab that appears, enter the custom domain you are using into the Custom Domain field.
This helps us to know which domain your customers will use when accessing your app, along with making sure that email communications point back to your domain.
Don’t forget to click Save in the console after making this change.
Step 2 - Configure an SSL cert in AWS ACM
Configure an SSL cert for the custom domain in AWS ACM.
You are configuring an SSL cert for the custom domain you want to use (E.g. app.mycustomdomain.com), not the *.mydevices.com URL that we provide to you.
The cert can either be requested for free in AWS ACM, or a commercial SSL cert from GoDaddy or other SSL cert provider can be purchased and imported to ACM. We recommend using ACM free certs because it's free and it handles renewals automatically.
The SSL Cert must be ready in ACM before Step 3 can be completed.
How to request free SSL cert in AWS ACM
If you want to follow the optional step of creating a free cert in AWS ACM, the following information will help guide you through this.
AWS docs on requesting free SSL cert in ACM: https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-public.htm
FQDN pictured in our example will be app.mycustomdomain.com
Step 1: Go to ACM and click Request certificate, then select Request a public certificate
Step 2:
Step 3: SSL cert request appears on the list of certificates and it needs to be validated:
Open the request, and add the required DNS records to complete validation.
If you host your domain in AWS too, then ACM can automatically add those records by clicking the appropriate button. If the domain is hosted elsewhere, those validation records must be added manually.
Once DNS records are ready, wait for ACM to change status for the SSL cert to Issued
.
Only when the SSL Cert shows Issued should you proceed to Step 3 to create CloudFront distribution.
Step 3 - Create CloudFront distribution
Default settings generally work, but below is a screenshot with the fields that we found need to be set / change from their default values. Everything else can stay unchanged.
Note: Origin domain is the domain from where CDN should pull the content from - please set it to the myDevices url for your app (e.g. yourcompany.mydevices.com). Refer to the URL shown in your white label settings in the IoT Console if unsure.
One note about the last highlighted field in the screenshot (Custom SSL certificate) - this is where the SSL cert for the custom domain appears if it was properly configured in ACM in Step 2. Although we have not selected anything in the screenshot (because we do not have SSL cert for our example domain), this field cannot be left empty - it must be set.
Step 3a - Create DNS record for your custom domain
Each CloudFront distribution has a unique domain name generated by AWS when the distribution is created. Create a CNAME record in your DNS provider, that points your custom domain at the unique hostname for your CloudFront distribution.
Example record:
Name: app.mycustomdomain.com
Type: CNAME
Value: unique domain name generated by CloudFront
After creating the DNS record, allow at least 1 min for DNS to propagate and then verify if the record has been created properly using one of many DNS lookup tools like DNS Propagation Checker - Global DNS Checker Tool .
Note: typically when making DNS changes, adding new entry propagates fast, but it’s not uncommon for modifications to an already existing record to take up to an hour or even longer. The time it takes for DNS change to propagate depends on how fast your provider applies your change and TTL (Time To Live) setting for your record. Explaining the concepts behind DNS is not part of this guide but please keep in mind, if DNS lookup tools indicate different results than you expect, double check your settings and then give it at least 1 hour to propagate.
Step 4 - Disable Caching (Optional, Troubleshooting)
There are two additional extra fields that can be set to disable CDN caching and forward all browser requests to the myDevices servers. By default, CloudFront uses aggressive caching and it might get in the way. Although we are not currently aware of any related issues, if any issues are observed, these two additional settings are the first actions to take to see if it improves anything.
Step 5 - Notify Us
As a final step, please Notify Us and include your details (your White label name, Custom URL being used) and let us know that you are done following the configuration guide. We will then verify things are working and apply any final steps needed on our side to ensure your custom domain URL will work.