-
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
(NLB): NetworkLoadBalancer.fromLookup returning dummy NLBs #26463
Comments
|
|
@peterwoodworth did you check the issue I mentioned in the bug section? why the method NetworkLoadBalancer.fromLookup is returning 3 results? and what could be the possible work around? |
I don't know what you mean by "returning three results". I took it to mean that one of those three results can occur any time you run this, in which case this would be easily solved by committing the |
Describe the bug
I am trying to fetch the NLB using its tags and using below method to fetch it.
`const nlb = this.getNLBByTag(tagNLB, props);
this.link = new VpcLink(this,
app-${props.stage}-vpclink
, {targets: [nlb],
});
private getNLBByTag(tag: string, props: APPDomainVPCStackProps): INetworkLoadBalancer{
const nlbOptions: NetworkLoadBalancerLookupOptions = {
loadBalancerTags: {
component: "apigw",
application: "app",
env: "dev"
},
};
return NetworkLoadBalancer.fromLookup(this,
app-${props.stage}-nlb
, nlbOptions);}`
Now this NetworkLoadBalancer.fromLookup method seems returning three results as below
Not sure why it is returning "my-load-balancer" nlb, even though it is not there in any of the AWS account and region.
Then for 2nd arn, it is showing dummy AZs: availabilityZones: [ 'dummy1a', 'dummy1b' ]
for 3rd arn: it is correct and that is what I am expecting. But ideally fromLookup method should only return one arn.
also in cdk.context.json file, I can only see one actual NLB, not any other dummy NLBs.
I am not checking-in this file cdk.context.json in git.
Expected Behavior
It should return only one arn which is mentioned in point #3 in describe section
Current Behavior
this NetworkLoadBalancer.fromLookup method returning three results as below
Reproduction Steps
npm install
cdk synth "" -c stage=$ENV
cdk deploy "" -c stage=$ENV --require-approval never
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.86.0
Framework Version
No response
Node.js Version
18
OS
Linux
Language
Typescript
Language Version
No response
Other information
Should we check-in cdk.context.json file in git?
Since I am running the cdk code using pipeline, that's why I have not committed cdk.context.json file, but I can see that the file is getting created and which has only one NLB and other vpc and subnet info.
The text was updated successfully, but these errors were encountered: