Interview Prep/Real-World Interview/DNS, TLS and certificates

A new ACM certificate has been "Pending validation" for six hours, and the ALB listener can't use it.

IntermediateTroubleshootingDNS, TLS and certificates
Answer

Likely causes → ACM can't see the DNS validation CNAME. It was created in the wrong hosted zone (a private zone, or a zone the domain doesn't delegate to), it has a typo or doubled domain suffix, or the domain has a CAA record that doesn't allow amazon.com.

Diagnose →

aws acm describe-certificate --certificate-arn $ARN \
  --query 'Certificate.DomainValidationOptions[].ResourceRecord'
dig +short _a1b2c3.app.example.com CNAME @8.8.8.8
dig +short CAA example.com
dig +short NS example.com

Fix → Create the exact CNAME in the public zone that's actually authoritative, add 0 issue "amazon.com" to CAA if you use CAA, and wait for ACM to re-check (it does so automatically).

Prevent → Create the cert and its validation record together in Terraform (aws_acm_certificate_validation), so the apply fails loudly instead of hanging in the console.

All Real-World Interview questions Roadmap: Interview readiness

More on DNS, TLS and certificates