Skip to content

Commit

Permalink
updated provider condition for security groups
Browse files Browse the repository at this point in the history
  • Loading branch information
lpizzinidev committed Jul 27, 2023
1 parent ab4867c commit cf4fcc9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/aws-cdk-lib/aws-eks/lib/kubectl-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,10 @@ export class KubectlProvider extends NestedStack implements IKubectlProvider {

// defined only when using private access
vpc: cluster.kubectlPrivateSubnets ? cluster.vpc : undefined,
securityGroups: cluster.kubectlSecurityGroup ? [cluster.kubectlSecurityGroup] : undefined,
vpcSubnets: cluster.kubectlPrivateSubnets ? { subnets: cluster.kubectlPrivateSubnets } : undefined,
securityGroups: cluster.kubectlPrivateSubnets && cluster.kubectlSecurityGroup ?
[cluster.kubectlSecurityGroup] : undefined,
vpcSubnets: cluster.kubectlPrivateSubnets && cluster.kubectlPrivateSubnets ?
{ subnets: cluster.kubectlPrivateSubnets } : undefined,
});

// allow user to customize the layers with the tools we need
Expand Down Expand Up @@ -194,7 +196,7 @@ export class KubectlProvider extends NestedStack implements IKubectlProvider {
onEventHandler: handler,
vpc: cluster.kubectlPrivateSubnets ? cluster.vpc : undefined,
vpcSubnets: cluster.kubectlPrivateSubnets ? { subnets: cluster.kubectlPrivateSubnets } : undefined,
securityGroups: cluster.kubectlSecurityGroup ? [cluster.kubectlSecurityGroup] : undefined,
securityGroups: cluster.kubectlPrivateSubnets && cluster.kubectlSecurityGroup ? [cluster.kubectlSecurityGroup] : undefined,
});

this.serviceToken = provider.serviceToken;
Expand Down

0 comments on commit cf4fcc9

Please sign in to comment.