Skip to content
This repository was archived by the owner on Jan 28, 2025. It is now read-only.

Commit 69574c7

Browse files
fix(serverless-component): fix for AWS accounts with more than 100 domains
1 parent 5384bfa commit 69574c7

File tree

1 file changed

+6
-2
lines changed
  • packages/serverless-components/domain

1 file changed

+6
-2
lines changed

packages/serverless-components/domain/utils.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ const getOutdatedDomains = (inputs, state) => {
8181
* - These don't need to be created and SHOULD NOT be modified.
8282
*/
8383
const getDomainHostedZoneId = async (route53, domain, privateZone) => {
84-
const hostedZonesRes = await route53.listHostedZonesByName().promise();
84+
const params = {
85+
DNSName: domain
86+
};
87+
88+
const hostedZonesRes = await route53.listHostedZonesByName(params).promise();
8589

8690
const hostedZone = hostedZonesRes.HostedZones.find(
8791
// Name has a period at the end, so we're using includes rather than equals
@@ -121,7 +125,7 @@ const getCertificateArnByDomain = async (acm, domain) => {
121125
for (const certificate of listRes.CertificateSummaryList) {
122126
if (certificate.DomainName === domain && certificate.CertificateArn) {
123127
if (domain.startsWith("www.")) {
124-
const nakedDomain = domain.replace("wwww.", "");
128+
const nakedDomain = domain.replace("www.", "");
125129
// check whether certificate support naked domain
126130
const certDetail = await describeCertificateByArn(
127131
acm,

0 commit comments

Comments
 (0)