Skip to content
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

[elasticloadbalancingv2] Exception in addTargetGroups when using conditions prop only #9320

Closed
AnatolyUA opened this issue Jul 29, 2020 · 1 comment · Fixed by #9939
Closed
Assignees
Labels
@aws-cdk/aws-elasticloadbalancingv2 Related to Amazon Elastic Load Balancing V2 bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@AnatolyUA
Copy link

At the moment I'm using this code to add a Target Group to ALB (java):

mainLBListener.addTargetGroups("EchoLambdaTg", AddApplicationTargetGroupsProps.builder().priority(100)
                                .conditions(List.of(ListenerCondition.pathPatterns(List.of("/links*"))))
                                .pathPattern("/links*").targetGroups(Collections.singletonList(tg)).build());

As I can understand pathPattern is @deprecated Use 'conditions' instead.. But when I remove it:

mainLBListener.addTargetGroups("EchoLambdaTg", AddApplicationTargetGroupsProps.builder().priority(100)
                                .conditions(List.of(ListenerCondition.pathPatterns(List.of("/links*"))))
                                .targetGroups(Collections.singletonList(tg)).build());

I get this exception:

An exception occured while executing the Java class. At least one of 'conditions', 'hostHeader', 'pathPattern' or 'pathPatterns' is required when defining a load balancing rule.
[ERROR] Error: At least one of 'conditions', 'hostHeader', 'pathPattern' or 'pathPatterns' is required when defining a load balancing rule.
[ERROR]     at new ApplicationListenerRule (/tmp/jsii-kernel-eV4MAc/node_modules/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener-rule.js:28:19)
[ERROR]     at ImportedApplicationListener.addTargetGroups (/tmp/jsii-kernel-eV4MAc/node_modules/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener.js:336:13)
[ERROR]     at /tmp/jsii-java-runtime6258021919515626221/jsii-runtime.js:7746:51
[ERROR]     at Kernel._wrapSandboxCode (/tmp/jsii-java-runtime6258021919515626221/jsii-runtime.js:8398:19)
[ERROR]     at /tmp/jsii-java-runtime6258021919515626221/jsii-runtime.js:7746:25
[ERROR]     at Kernel._ensureSync (/tmp/jsii-java-runtime6258021919515626221/jsii-runtime.js:8371:20)
[ERROR]     at Kernel.invoke (/tmp/jsii-java-runtime6258021919515626221/jsii-runtime.js:7745:26)
[ERROR]     at KernelHost.processRequest (/tmp/jsii-java-runtime6258021919515626221/jsii-runtime.js:7446:28)
[ERROR]     at KernelHost.run (/tmp/jsii-java-runtime6258021919515626221/jsii-runtime.js:7384:14)
[ERROR]     at Immediate.<anonymous> (/tmp/jsii-java-runtime6258021919515626221/jsii-runtime.js:7387:37)
[ERROR]     at process.processImmediate (internal/timers.js:439:21)

Environment

  • CLI Version : 1.55.0
  • Framework Version: 1.55.0
  • Node.js Version: v12.15.0
  • OS : Ubuntu / Windows 10
  • Language (Version): openjdk version "11.0.7" 2020-04-14

This is 🐛 Bug Report

@AnatolyUA AnatolyUA added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jul 29, 2020
@AnatolyUA AnatolyUA changed the title [module] elasticloadbalancingv2. Exception in addTargetGroups when using conditions prop only [elasticloadbalancingv2] Exception in addTargetGroups when using conditions prop only Jul 30, 2020
@github-actions github-actions bot added the @aws-cdk/aws-elasticloadbalancingv2 Related to Amazon Elastic Load Balancing V2 label Jul 30, 2020
@ericzbeard ericzbeard assigned rix0rrr and unassigned ericzbeard Jul 30, 2020
@rix0rrr
Copy link
Contributor

rix0rrr commented Aug 4, 2020

Duplicate of #9262

@rix0rrr rix0rrr marked this as a duplicate of #9262 Aug 4, 2020
@rix0rrr rix0rrr closed this as completed Aug 4, 2020
njlynch added a commit that referenced this issue Aug 24, 2020
…ribute

New conditions attribute usage was fixed in #8385 for owned listeners, but
missed imported listeners.

fixes #9262
fixes #9320
fixes #9643
mergify bot pushed a commit that referenced this issue Aug 24, 2020
…ribute (#9939)

New conditions attribute usage was fixed in #8385 for owned listeners, but
missed imported listeners.

fixes #9262
fixes #9320
fixes #9643


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-elasticloadbalancingv2 Related to Amazon Elastic Load Balancing V2 bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants