aws / aws/aws-cdk

ApplicationMultipleTargetGroupsFargateService: allow modify healthcheck path on each targetgroup

Open
#20,943 4 comments 3 reactions 0 assignees View on GitHub
@aws-cdk/aws-ecs effort/small feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### 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),
});

fargateService.targetGroup.configureHealthCheck({
path: "/8081-health-check-endpoint",
timeout: Duration.seconds(30),
interval: Duration.seconds(120),
unhealthyThresholdCount: 5,
healthyThresholdCount: 3,
})

### 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_

Contributor guide

Open the contributing guide

Research direction

Start at ApplicationMultipleTargetGroupsFargateService and trace how targetGroups are created and how targetGroup is exposed. Check the construct's existing tests or examples for health-check configuration. Done means each configured target group can independently receive health-check path and port settings, with coverage for the non-default groups.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.