Skip to content

Commit

Permalink
Don't cache the checker healthcheck endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathonherbert committed Jan 23, 2025
1 parent 60113a9 commit 73b66d1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cdk/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,16 @@ EOF
parameters.CheckerCertificate.valueAsString
);

const checkerOrigin = new LoadBalancerV2Origin(checkerApp.loadBalancer, {
protocolPolicy: OriginProtocolPolicy.HTTPS_ONLY,
});

const checkerCloudFrontDistro = new Distribution(
this,
"typerighter-cloudfront",
{
defaultBehavior: {
origin: new LoadBalancerV2Origin(checkerApp.loadBalancer, {
protocolPolicy: OriginProtocolPolicy.HTTPS_ONLY,
}),
origin: checkerOrigin,
allowedMethods: AllowedMethods.ALLOW_ALL,
cachePolicy: new CachePolicy(
this,
Expand All @@ -248,6 +250,8 @@ EOF
}
);

checkerCloudFrontDistro.addBehavior("/healthcheck", checkerOrigin, { cachePolicy: CachePolicy.CACHING_DISABLED });

const checkerDnsRecord = new GuDnsRecordSet(this, "checker-dns-records", {
name: checkerDomain,
recordType: RecordType.CNAME,
Expand Down

0 comments on commit 73b66d1

Please sign in to comment.