Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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;
}