How to use the @aws-cdk/aws-ec2.Subnet.isVpcSubnet function in @aws-cdk/aws-ec2

To help you get started, we’ve selected a few @aws-cdk/aws-ec2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws / aws-cdk / packages / @aws-cdk / aws-eks / lib / cluster.ts View on Github external
private tagSubnets() {
    for (const subnet of this.vpc.privateSubnets) {
      if (!Subnet.isVpcSubnet(subnet)) {
        // Just give up, all of them will be the same.
        this.node.addWarning('Could not auto-tag private subnets with "kubernetes.io/role/internal-elb=1", please remember to do this manually');
        return;
      }

      subnet.node.applyAspect(new Tag("kubernetes.io/role/internal-elb", "1"));
    }
  }
}