From 73b97998cc1d40e55f46cd1f022769fa34ab752d Mon Sep 17 00:00:00 2001 From: hannahhoward Date: Thu, 19 Sep 2024 13:04:26 -0700 Subject: [PATCH 1/2] fix(upload-api-stack): don't add domain to apiID on first zone In order to match the existing deployment, this PR will add the API ID for the first hosted zone. --- stacks/upload-api-stack.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stacks/upload-api-stack.js b/stacks/upload-api-stack.js index 3e0a98a4..6d91e078 100644 --- a/stacks/upload-api-stack.js +++ b/stacks/upload-api-stack.js @@ -55,9 +55,9 @@ export function UploadApiStack({ stack, app }) { const git = getGitInfo() const ucanInvocationPostbasicAuth = new Config.Secret(stack, 'UCAN_INVOCATION_POST_BASIC_AUTH') - const apis = (customDomains ?? [undefined]).map((customDomain) => { + const apis = (customDomains ?? [undefined]).map((customDomain, idx) => { const hostedZone = customDomain?.hostedZone - const apiId = [`http-gateway`, hostedZone?.replaceAll('.', '_')] + const apiId = [`http-gateway`, idx > 0 ? hostedZone?.replaceAll('.', '_') : ''] .filter(Boolean) .join('-') return new Api(stack, apiId, { From f1cd341d58c78553adc6139bfe77c28df97158b8 Mon Sep 17 00:00:00 2001 From: Hannah Howard Date: Thu, 19 Sep 2024 14:56:29 -0700 Subject: [PATCH 2/2] Update stacks/upload-api-stack.js Co-authored-by: Travis Vachon --- stacks/upload-api-stack.js | 1 + 1 file changed, 1 insertion(+) diff --git a/stacks/upload-api-stack.js b/stacks/upload-api-stack.js index 6d91e078..796fe407 100644 --- a/stacks/upload-api-stack.js +++ b/stacks/upload-api-stack.js @@ -57,6 +57,7 @@ export function UploadApiStack({ stack, app }) { const apis = (customDomains ?? [undefined]).map((customDomain, idx) => { const hostedZone = customDomain?.hostedZone + // the first customDomain will be web3.storage, and we don't want the apiId for that domain to have a second part, see PR of this change for context const apiId = [`http-gateway`, idx > 0 ? hostedZone?.replaceAll('.', '_') : ''] .filter(Boolean) .join('-')