Aws-cdk: ecs_patterns.ApplicationLoadBalancedFargateService should allow specifying healthCheck path

Created on 28 Feb 2020  路  2Comments  路  Source: aws/aws-cdk

ecs_patterns.ApplicationLoadBalancedFargateService should have a way to easily specify healtCheck for the loadbalancer.
Currently ApplicationLoadBalancedFargateService creates automatically a healthCheck that points to the root /. I'd like to specify another path.

Use Case

/ is not always suitablte to use as the healthCheck. In my case the correct path would be /health-check.

Proposed Solution

new ecs_patterns.ApplicationLoadBalancedFargateService(stack, 'Web', {
       ...
          // basically same thing as the listener.addTargets() takes
          healthCheck: {
              path: '/index.html',
              protocol: elbv2.Protocol.HTTP,
              port: '' + containerPort,
        },
});
  • [ ] :wave: I may be able to implement this feature request
  • [ ] :warning: This feature might incur a breaking change

This is a :rocket: Feature Request

@aws-cdaws-ecs-patterns feature-request p2

Most helpful comment

I had the same issue. There is a way to change the path by changing the targetGroup of the resulting service:

    service.targetGroup.configureHealthCheck({
      path: healthcheckEndpoint,
    });

All 2 comments

I had the same issue. There is a way to change the path by changing the targetGroup of the resulting service:

    service.targetGroup.configureHealthCheck({
      path: healthcheckEndpoint,
    });

@jls-tschanzc Thanks! That works fine.

Maybe there should be some pointers to above in js-docs for ApplicationLoadBalancedFargateService?

Was this page helpful?
0 / 5 - 0 ratings