How to use the @aws-cdk/aws-ec2.AnyIPv4 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-elasticloadbalancing / lib / load-balancer.ts View on Github external
ifUndefined(tryWellKnownProtocol(instancePort),
                 isHttpProtocol(protocol) ? LoadBalancingProtocol.Http : LoadBalancingProtocol.Tcp));

    this.listeners.push({
      loadBalancerPort: listener.externalPort.toString(),
      protocol,
      instancePort: instancePort.toString(),
      instanceProtocol,
      sslCertificateId: listener.sslCertificateId,
      policyNames: listener.policyNames
    });

    const port = new ListenerPort(this.securityGroup, new TcpPort(listener.externalPort));

    // Allow connections on the public port for all supplied peers (default: everyone)
    ifUndefined(listener.allowConnectionsFrom, [new AnyIPv4()]).forEach(peer => {
      port.connections.allowDefaultPortFrom(peer, `Default rule allow on ${listener.externalPort}`);
    });

    this.newInstancePort(instancePort);

    // Keep track using array so user can get to them even if they were all supplied in the constructor
    this.listenerPorts.push(port);

    return port;
  }