vercelDomain
View SourceVercel custom domain configuration enables using your own domain with Vercel-hosted applications by creating the necessary DNS records in Route53. This component sets up CNAME records that point to Vercel’s edge infrastructure for optimal performance and SSL certificate management.
import * as saws from "@stackattack/aws";
const ctx = saws.context();const vercelRecord = saws.vercelDomain(ctx, { domain: "app.example.com"});
export const domainRecord = vercelRecord.id;
After deployment, configure the domain in your Vercel project:
-
In Vercel Dashboard:
- Go to your project settings
- Add “app.example.com” as a custom domain
- Vercel will automatically issue SSL certificates
-
Using Vercel CLI:
Terminal window # Add domain to your projectvercel domains add app.example.com# Verify domain configurationvercel domains ls# Check SSL certificate statusvercel certs ls -
Verify DNS propagation:
Terminal window # Check CNAME recorddig CNAME app.example.com# Test HTTPS accesscurl -I https://app.example.com
Vercel domain configuration through AWS Route53 has minimal infrastructure costs:
- Route53 hosted zone: $0.50/month per domain
- DNS queries: $0.40 per million queries (typically <$1/month for most apps)
- Vercel hosting: Free tier available, Pro starts at $20/month per user
- SSL certificates: Free via Vercel (Let’s Encrypt)
This setup provides enterprise-grade edge performance with minimal operational overhead. Vercel handles SSL certificate renewal, CDN distribution, and edge caching automatically, making it cost-effective for modern web applications.
vercelDomain
Section titled “vercelDomain”Creates a CNAME record pointing a custom domain to Vercel’s DNS infrastructure.
function vercelDomain(ctx: Context, args: VercelDomainArgs): Record
Parameters
Section titled “Parameters”ctx
(Context
) - The context for resource naming and taggingargs
(VercelDomainArgs
) - Configuration arguments for the Vercel domain setup
Returns
Section titled “Returns”- (
Record
) - Creates a CNAME record pointing a custom domain to Vercel’s DNS infrastructure.
Interfaces
Section titled “Interfaces”VercelDomainArgs
Section titled “VercelDomainArgs”Configuration arguments for setting up a custom domain with Vercel.
Properties
Section titled “Properties”domain
(Input<string>
) - The custom domain name to configure for VercelnoPrefix?
(boolean
) - Whether to skip adding ‘vercel-domain’ prefix to resource namesttl?
(Input<number>
) - DNS record TTL in seconds (defaults to 300)zoneId?
(Input<string>
) - Route53 hosted zone ID (auto-detected from domain if not provided)