-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
(ecs): FargateService - register_load_balancer_target doesn't accept a valid listener when used with python 3.10.6 #25991
Comments
I can't reproduce this @Balaji-JBC, but this isn't a full snippet that will run out of the box since some of the resources aren't truly defined here. In addition to needing to define some additional resources that this snippet doesn't really do, you'll also find that there's something missing in the snippet. I am pretty sure you need to wrap the props passed into service.register_load_balancer_targets(ecs.EcsTarget(
container_name="web",
container_port=80,
new_target_group_id="ECS",
listener=ecs.ListenerConfig.application_listener(listener,
protocol=elbv2.ApplicationProtocol.HTTPS
)
)) Let me know if this helps, and we can track this as a documentation issue. You may also want to try reinstalling your packages and making sure all the CDK versions are the same, that's a pretty odd error you got for this. |
ecs.EcsTarget
builder in generated snippet
Hello @peterwoodworth . The proposed solution also didn't work. I got the same error. Here's the snippet
Got the same error
Edit: I'm using Python 3.10.6. Is that maybe causing the issue? |
ecs.EcsTarget
builder in generated snippet
Oh, this is because you're importing the ApplicationListener, which returns an |
|
Describe the bug
I try to register load balancer target using register load balancer targets. However, I always get a jsii type error. Intellisense and aws_cdk documentation have right examples
Expected Behavior
If the listener is of valid type. It's not supposed to throw any error
Current Behavior
Even when the listener is valid the following error is thrown
TypeError: type of argument listener must be aws_cdk.aws_elasticloadbalancingv2.ApplicationListener; got jsii._reference_map.InterfaceDynamicProxy instead
Reproduction Steps
This error can be reproduced by running the example provided in the aws_cdk documentation itself
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.63.2
Framework Version
No response
Node.js Version
18.16.0
OS
Ubuntu 22.04
Language
Python
Language Version
3.10.6
Other information
No response
The text was updated successfully, but these errors were encountered: