You have a domain pointing to CloudFront. You know the distribution exists because the application is accessible. You open the AWS CloudFront console, search through your distributions, and... nothing.
You try the AWS CLI:
aws cloudfront list-distributions Still nothing.
So where is the CloudFront distribution?
I recently encountered this situation while investigating an application hosted through AWS Amplify. The domain was resolving to CloudFront infrastructure, but its underlying distribution was nowhere to be found in the regular CloudFront distribution list.
The culprit was AWS Amplify Hosting.
This is an interesting example of how AWS-managed services can provision and operate infrastructure that you don't directly manage.
1. The mystery: A CloudFront distribution that doesn't exist in your account
The initial investigation looked straightforward.
The domain was accessible, and DNS resolution showed that traffic was reaching CloudFront infrastructure.
I checked the usual places:
- Route 53 hosted zones
- CloudFront distributions
- Application Load Balancers
- ECS services and tasks
But I couldn't find a corresponding CloudFront distribution in our regular CloudFront distribution list.
I also tried the AWS CLI:
aws cloudfront list-distributions \ --profile my-aws-profile No matching distribution.
This was particularly confusing because CloudFront is a global service. Switching AWS regions wouldn't help.
At this point, I started investigating whether another AWS service could be managing the distribution.
2. The culprit: AWS Amplify Hosting
AWS Amplify is a frontend application development and hosting platform.
If you've used Vercel, Amplify Hosting provides a similar experience:
- Connect a Git repository.
- Configure a build command.
- Automatically deploy applications when code changes.
- Configure custom domains.
- Enable HTTPS.
- Deliver application content through a CDN.
The important part is that Amplify manages much of the hosting infrastructure for you.
When you configure a custom domain for an Amplify application, Amplify provisions and manages the CloudFront infrastructure required to deliver your application.
Unlike a CloudFront distribution that you create directly through the CloudFront console, an Amplify-managed distribution is managed through the Amplify service rather than as a regular customer-managed CloudFront resource.
This explains why you may not find it through your usual CloudFront distribution listing.
3. Understanding the architecture
A simplified architecture looks like this:
DNS | v your-domain.com | v Amplify-managed CloudFront | v Amplify Hosting | v Deployed application Amplify manages the CDN layer, including its integration with the application and custom domain.
The CloudFront distribution is part of the hosting service's managed infrastructure.
This is an important distinction:
| Resource | Management |
|---|---|
| Amplify application | Customer-managed |
| Domain association | Managed through Amplify |
| DNS records | Managed through DNS provider |
| Underlying CloudFront infrastructure | Amplify-managed |
| Application deployment | Amplify-managed |
4. Why can't I use that CloudFront distribution?
This is where things get interesting.
Suppose you want to take an existing domain:
your-domain.com And associate it with your own CloudFront distribution.
You might expect to:
- Find the existing distribution.
- Remove the domain from its Alternate Domain Names (CNAMEs).
- Add the domain to your own distribution.
- Update your DNS records.
But you cannot simply follow this process because you don't have direct control over the Amplify-managed distribution.
There is also an important CloudFront restriction:
An alternate domain name can only be associated with one CloudFront distribution at a time.
This means you can encounter errors such as:
CNAMEAlreadyExistsException Even when you cannot find the conflicting distribution in your own CloudFront console.
The conflict may come from an Amplify-managed distribution or a distribution in another AWS account.
5. Why doesn't Route 53 always show the DNS record?
Another confusing aspect is the separation between DNS management and hosting infrastructure.
Amplify does not require Route 53 to host your DNS zone.
You can configure Amplify with:
- Amazon Route 53
- Cloudflare
- GoDaddy
- Other third-party DNS providers
Therefore, finding an Amplify-managed CloudFront distribution does not necessarily mean you will find its DNS record in Route 53.
Even when you use Route 53, wildcard records and delegated subdomains can make DNS resolution less obvious.
Useful commands for investigating DNS:
# Check DNS resolution dig your-domain.com A # Check CNAME records dig your-domain.com CNAME +short # Check authoritative nameservers dig your-domain.com NS +short # Trace DNS resolution dig +trace your-domain.com Don't assume that every working subdomain must have an explicit record in the parent hosted zone.
6. How to investigate an invisible CloudFront distribution
If you encounter this situation, I recommend following this checklist.
Step 1: Verify the DNS destination
dig your-domain.com CNAME +short dig your-domain.com A +short Look for a CloudFront hostname, such as:
d123456789.cloudfront.net Note that an A/ALIAS record might resolve to IP addresses rather than exposing the CloudFront hostname directly.
Step 2: Check your CloudFront distributions
aws cloudfront list-distributions \ --query 'DistributionList.Items[].{ Id:Id, Domain:DomainName, Aliases:Aliases.Items }' If you cannot find the domain, don't immediately assume the distribution doesn't exist.
Step 3: Check AWS Amplify
Navigate to:
AWS Console -> AWS Amplify -> All apps -> Select application -> Hosting -> Custom domains Check whether the domain is associated with an Amplify application.
Step 4: Check API Gateway
Another AWS service worth investigating is API Gateway.
When you configure an Edge-optimized custom domain, API Gateway provisions and manages a CloudFront distribution on your behalf.
This is another example of AWS-managed infrastructure that you don't directly control through the regular CloudFront workflow.
7. What if you need full CloudFront control?
If you need to configure custom cache behaviors, origins, WAF policies, headers, or routing rules, you may want to manage CloudFront yourself.
A possible architecture is:
Route 53 | v Your CloudFront | +-------+-------+ | | v v S3 Origin ALB / API Origin | | v v Static Assets ECS Fargate You can still use Amplify for application builds and deployments while managing your own CloudFront distribution in front of the application, provided the origin, domain association, and TLS configuration are set up correctly.
However, you should carefully plan the migration:
- Identify the existing Amplify domain association.
- Prepare your own CloudFront distribution.
- Configure the origin and SSL certificate.
- Remove or release the existing domain association through Amplify when appropriate.
- Associate the domain with your new distribution.
- Update DNS records.
- Verify traffic and HTTPS.
Don't remove the existing domain association until the replacement is ready. Otherwise, you risk downtime.
Conclusion
AWS managed services are convenient because they abstract away infrastructure management. However, that abstraction can become confusing when you're troubleshooting something at a lower infrastructure level.
A CloudFront distribution not appearing in your AWS account's regular distribution list doesn't necessarily mean it doesn't exist.
Before investigating IAM permissions, AWS accounts, or DNS configuration, check whether another AWS service is managing the distribution on your behalf.
In particular, remember these two services:
- AWS Amplify Hosting: Manages CloudFront infrastructure for frontend application hosting.
- Amazon API Gateway (Edge-optimized): Manages CloudFront infrastructure for API delivery.
Sometimes the infrastructure you're looking for is simply managed somewhere else in AWS.
