From 469ccca16eb66f363054c31c363b99057b0be3db Mon Sep 17 00:00:00 2001 From: khuezy Date: Thu, 10 Nov 2022 12:00:43 -0800 Subject: [PATCH] fix: Fix hosted zone lookup (#22) --- src/Nextjs.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Nextjs.ts b/src/Nextjs.ts index f81cec60..dcc49d9e 100644 --- a/src/Nextjs.ts +++ b/src/Nextjs.ts @@ -690,12 +690,12 @@ export class Nextjs extends Construct { hostedZone = route53.HostedZone.fromLookup(this, 'HostedZone', { domainName: customDomain, }); - } else if (customDomain.hostedZone) { - hostedZone = customDomain.hostedZone; } else if (typeof customDomain.hostedZone === 'string') { hostedZone = route53.HostedZone.fromLookup(this, 'HostedZone', { domainName: customDomain.hostedZone, }); + } else if (customDomain.hostedZone) { + hostedZone = customDomain.hostedZone; } else if (typeof customDomain.domainName === 'string') { // Skip if domain is not a Route53 domain if (customDomain.isExternalDomain === true) {