amplify-education / serverless-domain-manager

Serverless plugin for managing custom domains with API Gateways.
MIT License
941 stars 232 forks source link

Failed to find hosted zone when there are more than 100 HZs #510

Closed mrcrowl closed 2 years ago

mrcrowl commented 2 years ago

Community Note

Bug Report

Error Description When an AWS account has more than 100 hosted zones, the command, e.g.

sls create_domain --stage prod --region eu-west-2

... fails with Error: Could not find hosted zone "{ OUR.DOMAIN.NAME.HERE }"

Command Run e.g. sls create_domain --stage prod --region eu-west-2

Console Output

Error ---------------------------------------------------

  Error: Unable to create domain tabs.prod.eu-west-2.hungrycoder.net: Could not find hosted zone "{ OUR.DOMAIN.NAME.HERE }"
      at ServerlessCustomDomain.<anonymous> (/Users/Ben.Crowl/dev/tabs/node_modules/serverless-domain-manager/dist/src/index.js:190:23)
      at Generator.throw (<anonymous>)
      at rejected (/Users/Ben.Crowl/dev/tabs/node_modules/serverless-domain-manager/dist/src/index.js:6:65)
      at processTicksAndRejections (internal/process/task_queues.js:95:5)

Domain Manager Configuration Replace this with your own serverless.yml file (anonymized, of course) to help us better resolve your issue.

custom:
  customDomain: 
    domainName: OUR.DOMAIN.NAME.HERE

Versions

Possible Solution The following lines need to get paged results (node_modules/serverless-domain-manager/dist/src/aws/route53-wrapper.js)

            try {
                const hostedZoneData = yield (0, utils_1.throttledCall)(this.route53, "listHostedZones", {});
                hostedZones = hostedZoneData.HostedZones;
            }