Skip to content

Commit

Permalink
Merge pull request #239 from consensusnetworks/enhancement/cache-inva…
Browse files Browse the repository at this point in the history
…lidation

Add distribution cache invalidation paths
  • Loading branch information
shanejearley authored Jan 12, 2023
2 parents c309065 + 50be9ea commit 4df7038
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions infrastructure/cdk/lib/landing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 4df7038

Please sign in to comment.