Skip to content

vercelDomain

View Source

Vercel 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:

  1. In Vercel Dashboard:

    • Go to your project settings
    • Add “app.example.com” as a custom domain
    • Vercel will automatically issue SSL certificates
  2. Using Vercel CLI:

    Terminal window
    # Add domain to your project
    vercel domains add app.example.com
    # Verify domain configuration
    vercel domains ls
    # Check SSL certificate status
    vercel certs ls
  3. Verify DNS propagation:

    Terminal window
    # Check CNAME record
    dig CNAME app.example.com
    # Test HTTPS access
    curl -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.

Creates a CNAME record pointing a custom domain to Vercel’s DNS infrastructure.

function vercelDomain(ctx: Context, args: VercelDomainArgs): Record
  • ctx (Context) - The context for resource naming and tagging
  • args (VercelDomainArgs) - Configuration arguments for the Vercel domain setup
  • (Record) - Creates a CNAME record pointing a custom domain to Vercel’s DNS infrastructure.

Configuration arguments for setting up a custom domain with Vercel.

  • domain (Input<string>) - The custom domain name to configure for Vercel
  • noPrefix? (boolean) - Whether to skip adding ‘vercel-domain’ prefix to resource names
  • ttl? (Input<number>) - DNS record TTL in seconds (defaults to 300)
  • zoneId? (Input<string>) - Route53 hosted zone ID (auto-detected from domain if not provided)