Skip to content

Commit

Permalink
Fix public record (#756)
Browse files Browse the repository at this point in the history
* update public record

* fix typo
  • Loading branch information
larisa17 authored Dec 18, 2024
1 parent 125487c commit 2ea8009
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
4 changes: 3 additions & 1 deletion infra/aws/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
32 changes: 20 additions & 12 deletions infra/lib/scorer/new_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,8 @@ export async function createScoreExportBucketAndDomain(
domain: string,
route53Zone: string,
stack: string,
albDnsName: Output<any>
albDnsName: Output<any>,
albHostedZoneId: Output<any>
) {
const scoreBucket = new aws.s3.Bucket(domain, {
bucket: bucketName,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 2ea8009

Please sign in to comment.