-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
elbv2: ApplicationTargetGroup should validate that port is specified (when required) #4628
Comments
Hello @fogfish, The
Same with We could add some client-side checks (with exceptions being thrown), but I'm not sure it's possible to do it with types given the current API. |
Yes, this is definitely make sense. Thank you for hints! May be similar statement shall be applied to CDK docs Feel free to close the issue! One side comment. I've notice that similar issue is reflected to other |
Unfortunately we're not currently allowing type unions, since not all languages we're targeting with jsii support them natively and we haven't narrowed down a way to represent them in those languages. We can still keep this issue open, even if there is no static checking, there should be runtime validation in the construct so you don't need to wait for a CloudFormation deployment to detect this situation. |
Oh... True... TypeScript is not a central language for AWS CDK. I'll wish it will be the only one ;-) Thank you for feedback! |
I can take the PR if no one wants it 👍 |
I took a look into this, and it looks like the validation method is already there, introduced in #3348: aws-cdk/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-target-group.ts Lines 313 to 330 in 7ec598e
Since Outside of the fact that I'm pretty sure the error message ought to read "Both port and protocol is required" based on the logic, I don't think there's much to do here. @rix0rrr perhaps you can double check but I think this can just be closed. |
Please re-open if you are experiencing this issue |
|
ApplicationTargetGroupProps
defines all properties optional. However, it fails at runtime ifport
property is not defined.Reproduction Steps
Error Log
Environment
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: