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.
Contains the output for CreateLoadBalancer.
Namespace: Amazon.ElasticLoadBalancing.Model
Assembly: AWSSDK.ElasticLoadBalancing.dll
Version: 3.x.y.z
public class CreateLoadBalancerResponse : AmazonWebServiceResponse
The CreateLoadBalancerResponse type exposes the following members
Name | Description | |
---|---|---|
CreateLoadBalancerResponse() |
Name | Type | Description | |
---|---|---|---|
ContentLength | System.Int64 | Inherited from Amazon.Runtime.AmazonWebServiceResponse. | |
DNSName | System.String |
Gets and sets the property DNSName. The DNS name of the load balancer. |
|
HttpStatusCode | System.Net.HttpStatusCode | Inherited from Amazon.Runtime.AmazonWebServiceResponse. | |
ResponseMetadata | Amazon.Runtime.ResponseMetadata | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
This example creates a load balancer with an HTTP listener in a VPC.
var client = new AmazonElasticLoadBalancingClient(); var response = client.CreateLoadBalancer(new CreateLoadBalancerRequest { Listeners = new List<Listener> { new Listener { InstancePort = 80, InstanceProtocol = "HTTP", LoadBalancerPort = 80, Protocol = "HTTP" } }, LoadBalancerName = "my-load-balancer", SecurityGroups = new List<string> { "sg-a61988c3" }, Subnets = new List<string> { "subnet-15aaab61" } }); string dnsName = response.DNSName;
This example creates a load balancer with an HTTP listener in EC2-Classic.
var client = new AmazonElasticLoadBalancingClient(); var response = client.CreateLoadBalancer(new CreateLoadBalancerRequest { AvailabilityZones = new List<string> { "us-west-2a" }, Listeners = new List<Listener> { new Listener { InstancePort = 80, InstanceProtocol = "HTTP", LoadBalancerPort = 80, Protocol = "HTTP" } }, LoadBalancerName = "my-load-balancer" }); string dnsName = response.DNSName;
This example creates a load balancer with an HTTPS listener in a VPC.
var client = new AmazonElasticLoadBalancingClient(); var response = client.CreateLoadBalancer(new CreateLoadBalancerRequest { Listeners = new List<Listener> { new Listener { InstancePort = 80, InstanceProtocol = "HTTP", LoadBalancerPort = 80, Protocol = "HTTP" }, new Listener { InstancePort = 80, InstanceProtocol = "HTTP", LoadBalancerPort = 443, Protocol = "HTTPS", SSLCertificateId = "arn:aws:iam::123456789012:server-certificate/my-server-cert" } }, LoadBalancerName = "my-load-balancer", SecurityGroups = new List<string> { "sg-a61988c3" }, Subnets = new List<string> { "subnet-15aaab61" } }); string dnsName = response.DNSName;
This example creates a load balancer with an HTTPS listener in EC2-Classic.
var client = new AmazonElasticLoadBalancingClient(); var response = client.CreateLoadBalancer(new CreateLoadBalancerRequest { AvailabilityZones = new List<string> { "us-west-2a" }, Listeners = new List<Listener> { new Listener { InstancePort = 80, InstanceProtocol = "HTTP", LoadBalancerPort = 80, Protocol = "HTTP" }, new Listener { InstancePort = 80, InstanceProtocol = "HTTP", LoadBalancerPort = 443, Protocol = "HTTPS", SSLCertificateId = "arn:aws:iam::123456789012:server-certificate/my-server-cert" } }, LoadBalancerName = "my-load-balancer" }); string dnsName = response.DNSName;
This example creates an internal load balancer with an HTTP listener in a VPC.
var client = new AmazonElasticLoadBalancingClient(); var response = client.CreateLoadBalancer(new CreateLoadBalancerRequest { Listeners = new List<Listener> { new Listener { InstancePort = 80, InstanceProtocol = "HTTP", LoadBalancerPort = 80, Protocol = "HTTP" } }, LoadBalancerName = "my-load-balancer", Scheme = "internal", SecurityGroups = new List<string> { "sg-a61988c3" }, Subnets = new List<string> { "subnet-15aaab61" } }); string dnsName = response.DNSName;
.NET Core App:
Supported in: 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5, 4.0, 3.5