Routing traffic with route53 and cloudfront

From mouadja02/skills · View interactive version

Routing traffic with route53 and cloudfront is an AI agent skill from the GitHub repository mouadja02/skills. Use when routing a custom domain to Amazon CloudFront with Route 53 alias A/AAAA records, alternate domain names, ACM certificates, and IPv6. Coordinates readiness, DNS cutover, verification, and rollback across both services.

How to use this skill

Skill file

Attribution: Sourced from aws/agent-toolkit-for-aws by Amazon Web Services, licensed Apache-2.0. Modified for this collection.

Routing Traffic with Route 53 and CloudFront

When to Use

Do not use this skill for CloudFront caching/origin work without DNS changes; use

cloudfront. Do not use it for Route 53 records targeting non-CloudFront

endpoints; use route53.

Prerequisites and Quick Reference

TTLs, certificate ARN/status, and rollback target.

Overview

Domain expertise for configuring Amazon Route 53 to route traffic to Amazon CloudFront distributions using custom domain names. Covers hosted zone management, alias A/AAAA records, alternate domain name (CNAME) configuration, and ACM certificate setup for HTTPS.

Configure Route 53 to route traffic to a CloudFront distribution

To set up a custom domain for a CloudFront distribution with Route 53 DNS, follow the procedure exactly.

See Route 53 CloudFront routing procedure.

The procedure covers:

Verification and Recovery

  1. Before cutover, verify the certificate and distribution readiness checks above. Do not create the

alias first and hope the distribution converges later.

  1. After the change reports INSYNC, query authoritative name servers for A and AAAA, then make an

HTTPS request using the custom hostname. Assert the certificate hostname, expected distribution

response, and an application-specific body/header condition.

  1. Confirm direct origin access remains blocked when origin protection is expected.
  2. If any assertion fails, stop, restore the captured prior A/AAAA records, wait for that change to

become INSYNC, and repeat DNS and HTTPS checks. Preserve the failed change ID and observations.

Evaluation Prompts

IPv6 clients must work.”

Source Boundary

The certificate-region, alternate-domain, and Route 53 alias requirements are sourced from the AWS

documentation below and the imported Apache-2.0 upstream. The readiness gate, evidence capture,

application assertion, and rollback sequence are curator recommendations.

Additional Resources

Troubleshooting

Domain not in CloudFront CNAMEs

Add the domain as an alternate domain name in the CloudFront distribution configuration before creating Route 53 records.

SSL certificate issues

ACM certificates for CloudFront must be in us-east-1. Ensure the certificate is validated and associated with the distribution.

Private hosted zone

CloudFront only works with public hosted zones. Create a public hosted zone if only a private one exists.

DNS propagation delays

Changes typically propagate within 60 seconds but full global propagation can take up to 48 hours. Use nslookup or dig to verify.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.