From 44167e2ab89376592da1c349344d8e01e4b359a4 Mon Sep 17 00:00:00 2001 From: Daniel Van Der Ploeg Date: Mon, 22 May 2023 16:35:59 +0930 Subject: [PATCH] fix: set healthcheck to success on 401 status --- packages/prerender-fargate/lib/prerender-fargate.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/prerender-fargate/lib/prerender-fargate.ts b/packages/prerender-fargate/lib/prerender-fargate.ts index 622d35b5..4f4d23cb 100644 --- a/packages/prerender-fargate/lib/prerender-fargate.ts +++ b/packages/prerender-fargate/lib/prerender-fargate.ts @@ -94,6 +94,13 @@ export class PrerenderFargate extends Construct { } ); + 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,