From 032bf22209d28ccf83a42911e1d23c03271927d3 Mon Sep 17 00:00:00 2001 From: Austin Ely Date: Tue, 18 Apr 2023 15:28:51 -0400 Subject: [PATCH] fix: do record updates in parallel --- cf-custom-resources/lib/custom-domain.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cf-custom-resources/lib/custom-domain.js b/cf-custom-resources/lib/custom-domain.js index 539cbd07b9e..23a2ef81ef2 100644 --- a/cf-custom-resources/lib/custom-domain.js +++ b/cf-custom-resources/lib/custom-domain.js @@ -100,43 +100,45 @@ const writeCustomDomainRecord = async function ( aliasTypes, action ) { + const actions = []; for (const alias of aliases) { const aliasType = await getAliasType(aliasTypes, alias); switch (aliasType) { case aliasTypes.EnvDomainZone: - await writeARecord( + actions.push(writeARecord( envRoute53, alias, accessDNS, accessHostedZone, aliasType.domain, action - ); + )); break; case aliasTypes.AppDomainZone: - await writeARecord( + actions.push(writeARecord( appRoute53, alias, accessDNS, accessHostedZone, aliasType.domain, action - ); + )); break; case aliasTypes.RootDomainZone: - await writeARecord( + actions.push(writeARecord( appRoute53, alias, accessDNS, accessHostedZone, aliasType.domain, action - ); + )); break; // We'll skip if it is the other alias type since it will be in another account's route53. default: } } + await Promise.all(actions); }; const writeARecord = async function (