Custom Domains
Note - Deplify’s Custom Domain feature is not applicable when using the Terraform Provider Blueprint
or the CDK Provider Blueprint
It is very likely at some point you will want to use your own domain (or multiple domains) for your application. To do so, this involves two steps, validating you own the domain(s) & pointing your DNS provider to point traffic to your stack’s endpoint.
Validate You Own The Domain(s)
Navigate to the Domains page
- Navigate to the Stack page of the stack you want to use a custom domain(s) for.
- Click the
Domains
tab.
Create a Domain Set
- Click the
Add new custom domain set
button. - Enter in the domain(s) that you’d like to attach to your stack. The can be one or multiple domains. Do not include
https://
- Click the
Create
Button. - You should now see your domain set in the list of
Custom Domains
with a messageSet The Following Records On Your DNS Provider To Validate You Own This Domain
Add the Record(s) to your DNS Provider
- For each record in the list, you need to add the corresponding record in your DNS provider.
- The way of doing this depends on the DNS provider that is hosting your domain (GoDaddy, Namecheap, etc.) so follow the directions for the DNS Provider you are using.
- After adding the records, wait until the validation finishes. The status of domain set will change to
Ready For Use
after validation completes. The validation can take up to 10 minutes.
Enable The Custom Domain Set
- Use the toggle on the right side of the domain set to enable the domain on your stack.
- This will trigger a new deployment which can take up to 10 minutes to finish.
- Once the deployment is finished, your domain(s) is now attached to the stack successfully.
Routing Traffic To Your Stack.
Note - You can see your cloudfront distribution endpoint at the top of the Domains
page.
Now that you have the domain configured properly, you need to use your DNS provider to point the traffic of your domain(s) to your stacks cloudfront distribution endpoint. The process for this will differ based on if the domain you attached is a root domain or a subdomain.
For a Subdomain
As an example, if the domain you configured is app.example.com
. You will need to create a CNAME
record in your DNS provider that maps app
-> your cloudfront endpoint
. Once this change goes live you should be all good to go!
For a Root Domain
Note - When using a root domain like example.com
, the DNS provider you are using might not support root level ALIAS records. There are ways around this depending on the DNS provider you are using. Reach out to us if you need help.
In most cases, if using a domain like example.com
which is a root domain. You need to set an ALIAS
record in DNS provider that maps @
-> your cloudfront endpoint
. Once this change goes live you should be all good to go!
Using Route 53 As Your Domain Provider?
If you have used Route53 as your domain provider, your domain needs to be in the same account as the service AND you’ll need to configure things slightly differently. When you create the ALIAS record, instead of using the CloudFront domain, you have to choose the exact Cloudfront distribution that was created by Deplify.