createLoadBalancerListeners
abstract suspend fun createLoadBalancerListeners(input: CreateLoadBalancerListenersRequest): CreateLoadBalancerListenersResponse
Creates one or more listeners for the specified load balancer. If a listener with the specified port does not already exist, it is created; otherwise, the properties of the new listener must match the properties of the existing listener.
For more information, see Listeners for Your Classic Load Balancer in the Classic Load Balancers Guide.
Samples
// This example creates a listener for your load balancer at port 80 using the HTTP protocol.
elasticLoadBalancingClient.createLoadBalancerListeners {
loadBalancerName = "my-load-balancer"
listeners = listOf<Listener>(
Listener {
protocol = "HTTP"
loadBalancerPort = 80
instanceProtocol = "HTTP"
instancePort = 80
}
)
}Content copied to clipboard
// This example creates a listener for your load balancer at port 443 using the HTTPS protocol.
elasticLoadBalancingClient.createLoadBalancerListeners {
loadBalancerName = "my-load-balancer"
listeners = listOf<Listener>(
Listener {
protocol = "HTTPS"
loadBalancerPort = 443
instanceProtocol = "HTTP"
instancePort = 80
sslCertificateId = "arn:aws:iam::123456789012:server-certificate/my-server-cert"
}
)
}Content copied to clipboard