-
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
(ELB): Can't import 2 application listeners into the same scope #12132
Comments
If you change |
Thanks for you feedback, I tried to debug the source code and found the root cause.
Below is my code which will call elb.ApplicationListener.fromApplicationListenerAttributes twoice to get the HTTP application licenser and TLS application licenser:
|
It is indeed strange, that As a workaround, you can try to import each SecurityGroup yourself with |
Thanks, I tried to use ec2.SecurityGroup.fromSecurityGroupId and I changed to pass the id as a parameter instead of hard code with
|
But imported resources do not generate cloudformation, instead they just reference existing resources, so |
Thank you very much, this workaround works for me currently. |
Thanks for the debug @redbaron! Totally that. |
We were passing the wrong scope variable for the security group. Fixes #12132.
#12373) We were passing the wrong scope variable for the security group. Fixes #12132. PR notes: Yes I know this should formally have a unit test. I'm trying to quickly get rid of paper cuts via small edits that are "obviously" correct through quick edits. Adding tests slows the process down a lot and I'm not convinced a test would have appreciable benefit here, so I chose not to add one. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
❓ General Issue
The Question
Having an extended AWS-CDK libarary for creating Stacks and ECS services, etc, after upgrade AWS-CDK, there are problems runing unit-test which works fine previously, below is the detail error:
There is already a Construct with name 'SecurityGroup' in Stack [testStack]
Below is part of surce code of unit-test:
Cluster.fromStackExports will call Function.fromSecurityGroupId as below:
Could anyone help with this issue?
Environment
Other information
The text was updated successfully, but these errors were encountered: