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

ALB listener .addTargets bug with cdk.Duration and .toString (v0.36.0) #3080

Closed
1 task done
joshlartz opened this issue Jun 26, 2019 · 3 comments
Closed
1 task done
Assignees
Labels
@aws-cdk/aws-elasticloadbalancing Related to Amazon Elastic Load Balancing bug This issue is a bug.

Comments

@joshlartz
Copy link
Contributor

  • I'm submitting a ...

    • 🪲 bug report
  • What is the current behavior?
    If the current behavior is a 🪲bug🪲: Please provide the steps to reproduce

when calling .addTargets() against an elbv2.ApplicationListener with a config of:
{ ...,
deregistrationDelay: cdk.Duration.seconds(5),
...
}
the method tries to call .toString() on the Duration object and fails with an error about using .toSecond, etc. instead.

https://github.com/awslabs/aws-cdk/blob/master/packages/%40aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-target-group.ts#L208

  • What is the expected behavior (or behavior of feature suggested)?

.toString() should not be called against a Duration object. It results in a runtime error.

  • Please tell us about your environment:

    • CDK CLI Version: 0.36.0
    • Module Version: 0.36.0
    • OS: OSX Mojave
    • Language: all
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc)

@mhuebner
Copy link

mhuebner commented Jun 26, 2019

Same here:

Error: Argument to Intrinsic must be a plain value object, got () => {
            throw new Error(`Duration.toString() was used, but .toSeconds, .toMinutes or .toDays should have been called instead`);
        }

@rvdwijngaard
Copy link

+1

@NGL321 NGL321 added bug This issue is a bug. @aws-cdk/aws-elasticloadbalancing Related to Amazon Elastic Load Balancing labels Jun 27, 2019
@nmussy
Copy link
Contributor

nmussy commented Jul 22, 2019

Should be fixed with #3075

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-elasticloadbalancing Related to Amazon Elastic Load Balancing bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

6 participants