Open weiluo8791 opened 2 years ago
Thanks for reporting this! Our ECS Patterns constructs can often leave behind some configurability in favor of creating higher level abstractions. If you, or anyone can find a way to configure this setting better for each target group, we'd be happy to review a PR. The team probably won't be able to get to this soon. Check out the contributing guide if you're interested!
i've found the service.targetGroups
array's ordering to be consistent with how you configured it initially, so you can go service.targetGroups[0].configureHealthCheck()
as a workaround
Describe the bug
There is no ability to change or modify the healthcheck path or port for each targetgroup it created. I can only modify the first targetgroup (default).
Expected Behavior
be able to change and modify each targetgroup's healthcheck setting
Current Behavior
const fargateService = new ecs_patterns.ApplicationMultipleTargetGroupsFargateService(this, "MyFargateService", { serviceName: "ecs-service-name", desiredCount: 2, cluster, taskDefinition, assignPublicIp: false, loadBalancers: [applicationLoadBalancerProps], targetGroups: [ { containerPort: 8081, protocol: ecs.Protocol.TCP, }, { containerPort: 8082, pathPattern: "/route1/", priority: 2, protocol: ecs.Protocol.TCP, }, { containerPort: 8082, pathPattern: "/route2/", priority: 3, protocol: ecs.Protocol.TCP, }, ], healthCheckGracePeriod: Duration.seconds(300), });
Reproduction Steps
use the example code
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.12
Framework Version
No response
Node.js Version
14.17.3
OS
Mac OS 11.6.7
Language
Typescript
Language Version
No response
Other information
No response