aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

ecsPatterns.ApplicationLoadBalancedFargateService: targetGroup cannot be declared.

Open ZenergyBryson opened this issue 1 year ago • 1 comments
trafficstars

Describe the issue

This is my first submission, so try not to rake me over the coals too harshly if this is a bug and not a documentation issue.

In the documentation, targetGroup shows up in the Properties table, along with loadBalancer, certificate, and other properties that CAN be assigned. I have verified I'm using CDK v2.141.0 on my local, and am reading the docs for 2.141.0, but when I try to run diff, synth, or deploy I get this: error TS2345: Argument of type '{ loadBalancer: cdk.aws_elasticloadbalancingv2.IApplicationLoadBalancer; targetGroup: cdk.aws_elasticloadbalancingv2.IApplicationTargetGroup; publicLoadBalancer: false; ... 14 more ...; openListener: false; }' is not assignable to parameter of type 'ApplicationLoadBalancedFargateServiceProps'. Object literal may only specify known properties, and 'targetGroup' does not exist in type 'ApplicationLoadBalancedFargateServiceProps'. 179 targetGroup: jenkinsTargetGroup,

Links

https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs_patterns.ApplicationLoadBalancedFargateService.html

ZenergyBryson avatar May 10 '24 21:05 ZenergyBryson

Using the NPM semver calculator, it can be seen that >4 results in no matches, while ^4 would include everything from 4.0.0 and beyond.

torickjdavis avatar May 10 '24 00:05 torickjdavis

Thanks for noticing, the the PR. The issue with ^ is that it also just limits it to the specific major version, which isn't necessarily required in each case, for example ink-form works fine with both ink 4 and ink 5. I've updated the range to >=4 which should now be correct.

lukasbach avatar May 18 '24 14:05 lukasbach