Aws-cdk: LoadBalancedFargateService: Add ability to specify Health Check path

Created on 23 Apr 2019  路  5Comments  路  Source: aws/aws-cdk

We are using LoadBalancedFargateService to generate some Fargate services.

Currently, the health check path defaults to root. "/"
We need to set the health check path for each Fargate service.

Having the ability to specify or change the health check path would be greatly be appreciated!
Is there a workaround available for this?

Thanks! 馃悎

@aws-cdaws-ecs-patterns feature-request

Most helpful comment

I found I was able to access the health check settings via:

const server = new ApplicationLoadBalancedFargateService(...)
server.targetGroup.configureHealthCheck({
      path: "/health",
      interval: Duration.seconds(120),
      unhealthyThresholdCount: 5,
      ... etc
}); 

All 5 comments

You can have a look at my template for creating a basic Fargate cluster: https://github.com/markusl/cdk-fargate-docker-starter/blob/master/lib/cdk-fargate-starter-docker-stack.ts

You can easily specify custom health check:

      .addTargets(..., {
        // ...
        healthCheck: {
          path: '/health-check',
        },
      });

But you are creating the resources manually. The request is to add health checks to the LoadBalancedFargateService L2 construct. This would really be great.

Closing due to old data (see comments in #2704).

If closing was incorrect, feel free to reopen.

馃樃

I could not find any solution other than creating all resources manually, defeating the purpose of LoadBalancedFargateService. #2704 was closed, but the solution isn't clear

I found I was able to access the health check settings via:

const server = new ApplicationLoadBalancedFargateService(...)
server.targetGroup.configureHealthCheck({
      path: "/health",
      interval: Duration.seconds(120),
      unhealthyThresholdCount: 5,
      ... etc
}); 
Was this page helpful?
0 / 5 - 0 ratings