Skip to content

Commit

Permalink
fix(upload-api-stack): don't add domain to apiID on first zone (#420)
Browse files Browse the repository at this point in the history
# Goals

resolve
https://console.seed.run/dag-house/w3infra/activity/stages/staging/builds/386/services/upload-api

Essentially cause the up.web3.storage domain apiID changes, it tries to
recreate the domain record, and it can't. So the solution is don't
change the API ID for the web3.storage domain.

# Implementation

In order to match the existing deployment, this PR will not add the
domain to the first API ID for the first hosted zone.

---------

Co-authored-by: Travis Vachon <[email protected]>
  • Loading branch information
hannahhoward and travis authored Sep 19, 2024
1 parent 3749515 commit 64ddde3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions stacks/upload-api-stack.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ 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('.', '_')]
// 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('-')
return new Api(stack, apiId, {
Expand Down

0 comments on commit 64ddde3

Please sign in to comment.