Edge Settings and Custom Domains
Configure CloudFront cache behavior and connect a custom domain to production.
Configure Amazon CloudFront caching behavior and connect custom domains to your production environments.
This guide covers cache purges, certificate validation, CloudFront attachment, and Domain Name System (DNS) records.
About Cache Purges
Amazon CloudFront caches application assets at edge locations to reduce latency. When you enable the Purge cache after each deployment option, monolayer invalidates the CloudFront cache during each rollout.
Enable cache purges only when stale asset delivery is a problem. Frequent purges can increase propagation time and edge cost.
Connecting a Custom Domain
Follow these steps to connect a custom domain you purchased outside monolayer. You must generate a certificate, validate domain ownership, attach the certificate to your CloudFront distribution, and update your DNS records.
Before you start
You must deploy your production environment at least once before connecting a custom domain.
Steps
Generating a Certificate
- Choose Settings > Edge in the project sidebar.
- Type the fully qualified domain name in the Domain field, such as
app.example.com. - Click Generate certificate.
monolayer requests a certificate from Amazon Web Services (AWS) Certificate Manager (ACM) and changes the custom domain status to
VALIDATE_CERTIFICATE.
Validating Domain Ownership
- Copy the generated canonical name (CNAME) record name, type, and value from the Domain Validation panel.
- Add the CNAME validation records to your DNS registrar.
- Wait for DNS propagation.
When ACM verifies domain ownership, the status changes to
ISSUED.
Attaching the Certificate
- Click Attach certificate to CloudFront.
- Wait for AWS to update the CloudFront distribution.
The status changes to
UPDATE_DNS_RECORDSand displays the target CloudFront distribution domain.
Routing Traffic
- Copy the CloudFront distribution domain.
- Add an A record for your root domain with alias routing, or a CNAME record for a subdomain, and point it to the CloudFront distribution domain.
The custom domain status changes to
ACTIVE, and your application is available at your custom domain.