AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Container for the parameters to the CreateLoadBalancerListeners operation. 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.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceRequest
    Amazon.ElasticLoadBalancing.AmazonElasticLoadBalancingRequest
      Amazon.ElasticLoadBalancing.Model.CreateLoadBalancerListenersRequest

Namespace: Amazon.ElasticLoadBalancing.Model
Assembly: AWSSDK.ElasticLoadBalancing.dll
Version: 3.x.y.z

Syntax

C#
public class CreateLoadBalancerListenersRequest : AmazonElasticLoadBalancingRequest
         IAmazonWebServiceRequest

The CreateLoadBalancerListenersRequest type exposes the following members

Constructors

NameDescription
Public Method CreateLoadBalancerListenersRequest()

Empty constructor used to set properties independently even when a simple constructor is available

Public Method CreateLoadBalancerListenersRequest(string, List<Listener>)

Instantiates CreateLoadBalancerListenersRequest with the parameterized properties

Properties

NameTypeDescription
Public Property Listeners System.Collections.Generic.List<Amazon.ElasticLoadBalancing.Model.Listener>

Gets and sets the property Listeners.

The listeners.

Public Property LoadBalancerName System.String

Gets and sets the property LoadBalancerName.

The name of the load balancer.

Examples

This example creates a listener for your load balancer at port 80 using the HTTP protocol.

To create an HTTP listener for a load balancer


var client = new AmazonElasticLoadBalancingClient();
var response = client.CreateLoadBalancerListeners(new CreateLoadBalancerListenersRequest 
{
    Listeners = new List<Listener> {
        new Listener {
            InstancePort = 80,
            InstanceProtocol = "HTTP",
            LoadBalancerPort = 80,
            Protocol = "HTTP"
        }
    },
    LoadBalancerName = "my-load-balancer"
});


            

This example creates a listener for your load balancer at port 443 using the HTTPS protocol.

To create an HTTPS listener for a load balancer


var client = new AmazonElasticLoadBalancingClient();
var response = client.CreateLoadBalancerListeners(new CreateLoadBalancerListenersRequest 
{
    Listeners = new List<Listener> {
        new Listener {
            InstancePort = 80,
            InstanceProtocol = "HTTP",
            LoadBalancerPort = 443,
            Protocol = "HTTPS",
            SSLCertificateId = "arn:aws:iam::123456789012:server-certificate/my-server-cert"
        }
    },
    LoadBalancerName = "my-load-balancer"
});


            

Version Information

.NET Core App:
Supported in: 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5, 4.0, 3.5