From 50be9eade49afd1e97fba3c7670f53a20e4fff7e Mon Sep 17 00:00:00 2001 From: Shane Earley Date: Thu, 12 Jan 2023 18:10:52 -0500 Subject: [PATCH] Add distribution cache invalidation paths --- infrastructure/cdk/lib/landing.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/infrastructure/cdk/lib/landing.ts b/infrastructure/cdk/lib/landing.ts index 73b4eb73c..7da2a70e1 100644 --- a/infrastructure/cdk/lib/landing.ts +++ b/infrastructure/cdk/lib/landing.ts @@ -61,11 +61,6 @@ export class LandingStack extends Stack { accessControl: BucketAccessControl.PRIVATE }) - new BucketDeployment(this, `${project}${this.service}BucketDeployment${stage}`, { - destinationBucket: bucket, - sources: [Source.asset(this.assetPath)] - }) - const originAccessIdentity = new OriginAccessIdentity(this, `${project}${this.service}OriginAccessIdentity${stage}`) bucket.grantRead(originAccessIdentity) @@ -93,6 +88,13 @@ export class LandingStack extends Stack { certificate }) + new BucketDeployment(this, `${project}${this.service}BucketDeployment${stage}`, { + destinationBucket: bucket, + sources: [Source.asset(this.assetPath)], + distribution, + distributionPaths: ['/*'] + }) + new route53.ARecord(this, `${project}${this.service}DnsARecord${stage}`, { recordName: serviceDomain, zone: hostedZone as route53.IHostedZone,