There are more AWS SDK examples available in the AWS Doc SDK Examples
Use DescribeLoadBalancers
with an AWS SDK or CLI
The following code examples show how to use DescribeLoadBalancers
.
Action examples are code excerpts from larger programs and must be run in context. You can see this action in context in the following code example:
- AWS SDK for .NET
-
Note
There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository
. /// <summary> /// Get the HTTP Endpoint of a load balancer by its name. /// </summary> /// <param name="loadBalancerName">The name of the load balancer.</param> /// <returns>The HTTP endpoint.</returns> public async Task<string> GetEndpointForLoadBalancerByName(string loadBalancerName) { if (_endpoint == null) { var endpointResponse = await _amazonElasticLoadBalancingV2.DescribeLoadBalancersAsync( new DescribeLoadBalancersRequest() { Names = new List<string>() { loadBalancerName } }); _endpoint = endpointResponse.LoadBalancers[0].DNSName; } return _endpoint; }
-
For API details, see DescribeLoadBalancers in AWS SDK for .NET API Reference.
-