Custom Domains API
This API allows you to add multiple custom domains to your service.
Endpoints
Action | Method | Endpoint |
---|---|---|
Create certificate group with domains | POST | /v1/services/{serviceId}/domain-certificate-groups |
Get domains from a group | GET | /v1/domain-certificate-groups/{domainGroupId}/domains |
Get service domain groups | GET | /v1/services/{serviceId}/domain-certificate-groups |
Get a single domain group | GET | /v1/domain-certificate-groups/{domainGroupId} |
Get a single domain | GET | /v1/domains/{domainId} |
Add domains to a group | POST | /v1/domain-certificate-groups/{domainGroupId}/domains |
Delete a single domain | DELETE | /v1/domain-certificate-groups/{domainGroupId}/domains/{managedDomainId} |
How It Works
Custom domains are linked to a CloudFront distribution that routes traffic to your service. To enable secure connections, this setup requires an SSL/TLS certificate.
We group these elements — domains, CloudFront distribution, and certificate — under the concept of a Domain Certificate Group.
A Domain Certificate Group can either:
- Use the default CloudFront distribution automatically provisioned with the service, or
- Be associated with a new, separately created CloudFront distribution.
Once you create a domain group with domains, we initiate the setup by requesting a certificate from AWS. This process generates DNS records required to verify domain ownership, which are labeled as CERTIFICATE_DOMAIN_VERIFICATION
in our API.
Once you add these DNS records, the following happens automatically:
- AWS detects the records and issues the certificate.
- Flightcontrol attaches both the certificate and the domains to the CloudFront distribution.
- At this point, the domains are ready to serve traffic. If you haven’t already, you now need to update your DNS settings to point the domain to the CloudFront distribution.
The key endpoints you’ll need when first setting up the domains are:
- Create a domain certificate group →
POST /v1/services/{serviceId}/domain-certificate-groups
- Get domains from a certificate group →
GET /v1/domain-certificate-groups/{domainGroupId}/domains
- Returns the domains and required DNS records after the group is created.
- After adding the DNS records, use this endpoint to track domain attachment.