Certbot Unable to find a Route53 hosted zone for _acme-challenge.subdomain.domain.com

Viewed 2180

I would like to create an SSL certificate using certbot for subdomains pointing to my domain. But upon generating the command below, I am receiving this error: certbot.errors.PluginError: Unable to find a Route53 hosted zone for _acme-challenge.hello.example.com

Here's the command:

sudo certbot certonly -d hello.example.com --dns-route53 -n --agree-tos --non-interactive --server https://acme-v02.api.letsencrypt.org/directory -i apache

Main subdomain: my.subdomain.com

Other subdomains:

  1. hello.example.com -> CNAME to secure.subdomain.com
  2. world.another-example.com -> CNAME to secure.subdomain.com

So visiting these subdomains should show the my.subdomain.com webpage with their corresponding SSL certificate.

2 Answers

This error usually occurs when you have valid AWS credentials, but your domain is not listed in Route53 of that AWS account.

  1. Check ~/.aws/credentials file - does it contain credentials for particular aws account with this hosted-zone
  2. It should be default profile. e.x.
[default]
aws_access_key_id = your_aws_id_hosted_zone
aws_secret_access_key = your_aws_secret_hosted_zone
Related