Lambda URL CloudFront DNS Route53

Jets can automatically create a DNS Route53 record pointing to the managed CloudFront domain.

Enabling

To enable the DNS Route53 record creation:

config/jets/deploy.rb

Jets.deploy.configure do
  config.lambda.url.cloudfront.enable = true
  config.lambda.url.cloudfront.cert.arn = acm_cert_arn(domain: "example.com", region: "us-east-1")
  # config.lambda.url.cloudfront.aliases = [
  #   "www.example.com"
  # ]

  config.lambda.url.cloudfront.route53.enable = true # <= ENABLE
end
  • A conventional alias is created by default with the Jets project name and env. IE: project: demo and Jets.env: dev => demo-dev.domain.com.
  • The conventional alias domain is inferred by from the ACM cert configured in cloudfront.cert.arn. It’s domain name is used to look up the route53 hosted zone name.
  • If you set cloudfront.aliases then the conventional alias is not set.

    JETS_ENV=dev jets deploy => demo-dev.example.com JETS_ENV=prod jets deploy => demo-prod.example.com JETS_EXTRA=beta jets deploy => demo-dev-beta.example.com JETS_EXTRA=2 jets deploy => demo-dev-2.example.com

All route53 DNS aliases have the same TTL values and point to the same CloudFront Distribution domain name. Example:

demo-dev.domain.com => https://d1cfl6s9mcuypm.cloudfront.net
name1.domain.com    => https://d1cfl6s9mcuypm.cloudfront.net
name2.domain.com    => https://d1cfl6s9mcuypm.cloudfront.net
my.domain.com       => https://d1cfl6s9mcuypm.cloudfront.net