Skip to content

Commit

Permalink
Merge pull request #1047 from aligent/fix/authentication-priority
Browse files Browse the repository at this point in the history
fix: set healthcheck to success on 401 status
  • Loading branch information
TheOrangePuff authored May 22, 2023
2 parents fe3e51b + f21abb7 commit a4b1c16
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/prerender-fargate/lib/prerender-fargate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ export class PrerenderFargate extends Construct {
}
);

// As the prerender service will return a 401 on all unauthorised requests
// it should be considered healthy when receiving a 401 response
fargateService.targetGroup.configureHealthCheck({
path: "/health",
interval: Duration.seconds(120),
unhealthyThresholdCount: 5,
healthyHttpCodes: '401'
});

// Setup AutoScaling policy
const scaling = fargateService.service.autoScaleTaskCount({
maxCapacity: props.maxInstanceCount || 2,
Expand Down

0 comments on commit a4b1c16

Please sign in to comment.