From 9368ecab376a69c0867ac4f331ccb347dc521edf Mon Sep 17 00:00:00 2001 From: Tyler Schloesser Date: Tue, 16 Jan 2024 10:08:45 -0800 Subject: [PATCH] fix root hosted zone --- cdk/src/cdk-stack.ts | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/cdk/src/cdk-stack.ts b/cdk/src/cdk-stack.ts index a7fd4ae..2681430 100644 --- a/cdk/src/cdk-stack.ts +++ b/cdk/src/cdk-stack.ts @@ -7,7 +7,6 @@ import { Distribution, ViewerProtocolPolicy } from 'aws-cdk-lib/aws-cloudfront' import { S3Origin } from 'aws-cdk-lib/aws-cloudfront-origins' import { ARecord, - IHostedZone, PublicHostedZone, RecordSet, RecordTarget, @@ -32,17 +31,9 @@ export class CdkStack extends Stack { zoneName: domainName, }) - let rootHostedZone: IHostedZone - - if (process.env.STAGE === 'prod') { - rootHostedZone = new PublicHostedZone(this, 'RootHostedZone', { - zoneName: 'haitianrelief.org', - }) - } else { - rootHostedZone = PublicHostedZone.fromLookup(this, 'RootHostedZone', { - domainName: 'haitianrelief.org', - }) - } + const rootHostedZone = PublicHostedZone.fromLookup(this, 'RootHostedZone', { + domainName: 'haitianrelief.org', + }) let certificate: Certificate if (process.env.STAGE === 'prod') {