diff --git a/infra/aws/index.ts b/infra/aws/index.ts index 210e71c7d..762f729c2 100644 --- a/infra/aws/index.ts +++ b/infra/aws/index.ts @@ -164,6 +164,7 @@ const corePrivateSubnetIds = coreInfraStack.getOutput("privateSubnetIds"); const rdsSecretArn = coreInfraStack.getOutput("rdsSecretArn"); const albDnsName = coreInfraStack.getOutput("coreAlbDns"); +const albHostedZoneId = coreInfraStack.getOutput("coreAlbZoneId"); const CERAMIC_CACHE_SCORER_ID_CONFG = Object({ review: 1, staging: 14, @@ -1487,7 +1488,8 @@ const exportVals = createScoreExportBucketAndDomain( publicDataDomain, route53ZoneForPublicData, stack, - albDnsName + albDnsName, + albHostedZoneId ); // The following scorer dumps the Allo scorer scores to a public S3 bucket // for the Allo team to easily pull the data diff --git a/infra/lib/scorer/new_service.ts b/infra/lib/scorer/new_service.ts index 2e6d9c839..b4be7dc62 100644 --- a/infra/lib/scorer/new_service.ts +++ b/infra/lib/scorer/new_service.ts @@ -445,7 +445,8 @@ export async function createScoreExportBucketAndDomain( domain: string, route53Zone: string, stack: string, - albDnsName: Output + albDnsName: Output, + albHostedZoneId: Output ) { const scoreBucket = new aws.s3.Bucket(domain, { bucket: bucketName, @@ -611,17 +612,24 @@ export async function createScoreExportBucketAndDomain( // }); // This will return a static response - pulumi.all([albDnsName]).apply(([_albDnsName]) => { - if (stack === "production") { - new aws.route53.Record(domain, { - name: domain, - zoneId: route53Zone, - type: "CNAME", - ttl: 300, - records: [_albDnsName], - }); - } - }); + pulumi + .all([albDnsName, albHostedZoneId]) + .apply(([_albDnsName, _albHostedZoneId]) => { + if (stack === "production") { + new aws.route53.Record(domain, { + name: domain, + zoneId: route53Zone, + type: "A", + aliases: [ + { + name: _albDnsName, + zoneId: _albHostedZoneId, + evaluateTargetHealth: false, + }, + ], + }); + } + }); return { exportCertificate, publicExportCertificateValidationDomain,