Note:

You are viewing the documentation for an older major version of the AWS CLI (version 1).

AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, click here. For more information see the AWS CLI version 2 installation instructions and migration guide.

[ aws . elbv2 ]

describe-load-balancers

Description

Describes the specified load balancers or all of your load balancers.

See also: AWS API Documentation

describe-load-balancers is a paginated operation. Multiple API calls may be issued in order to retrieve the entire data set of results. You can disable pagination by providing the --no-paginate argument. When using --output text and the --query argument on a paginated response, the --query argument must extract data from the results of the following query expressions: LoadBalancers

Synopsis

  describe-load-balancers
[--load-balancer-arns <value>]
[--names <value>]
[--page-size <value>]
[--cli-input-json <value>]
[--starting-token <value>]
[--max-items <value>]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]

Options

--load-balancer-arns (list)

The Amazon Resource Names (ARN) of the load balancers. You can specify up to 20 load balancers in a single call.

(string)

Syntax:

"string" "string" ...

--names (list)

The names of the load balancers.

(string)

Syntax:

"string" "string" ...

--page-size (integer)

The size of each page to get in the AWS service call. This does not affect the number of items returned in the command's output. Setting a smaller page size results in more calls to the AWS service, retrieving fewer items in each call. This can help prevent the AWS service calls from timing out.

For usage examples, see Pagination in the AWS Command Line Interface User Guide .

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--starting-token (string)

A token to specify where to start paginating. This is the NextToken from a previously truncated response.

For usage examples, see Pagination in the AWS Command Line Interface User Guide .

--max-items (integer)

The total number of items to return in the command's output. If the total number of items available is more than the value specified, a NextToken is provided in the command's output. To resume pagination, provide the NextToken value in the starting-token argument of a subsequent command. Do not use the NextToken response element directly outside of the AWS CLI.

For usage examples, see Pagination in the AWS Command Line Interface User Guide .

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

Global Options

--debug (boolean)

Turn on debug logging.

--endpoint-url (string)

Override command's default URL with the given URL.

--no-verify-ssl (boolean)

By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.

--no-paginate (boolean)

Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.

--output (string)

The formatting style for command output.

  • json
  • text
  • table

--query (string)

A JMESPath query to use in filtering the response data.

--profile (string)

Use a specific profile from your credential file.

--region (string)

The region to use. Overrides config/env settings.

--version (string)

Display the version of this tool.

--color (string)

Turn on/off color output.

  • on
  • off
  • auto

--no-sign-request (boolean)

Do not sign requests. Credentials will not be loaded if this argument is provided.

--ca-bundle (string)

The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.

--cli-read-timeout (int)

The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.

--cli-connect-timeout (int)

The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.

Examples

Note

To use the following examples, you must have the AWS CLI installed and configured. See the Getting started guide in the AWS CLI User Guide for more information.

Unless otherwise stated, all examples have unix-like quotation rules. These examples will need to be adapted to your terminal's quoting rules. See Using quotation marks with strings in the AWS CLI User Guide .

To describe a load balancer

This example describes the specified load balancer.

Command:

aws elbv2 describe-load-balancers --load-balancer-arns arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188

Output:

{
  "LoadBalancers": [
      {
          "Type": "application",
          "Scheme": "internet-facing",
          "IpAddressType": "ipv4",
          "VpcId": "vpc-3ac0fb5f",
          "AvailabilityZones": [
              {
                  "ZoneName": "us-west-2a",
                  "SubnetId": "subnet-8360a9e7"
              },
              {
                  "ZoneName": "us-west-2b",
                  "SubnetId": "subnet-b7d581c0"
              }
          ],
          "CreatedTime": "2016-03-25T21:26:12.920Z",
          "CanonicalHostedZoneId": "Z2P70J7EXAMPLE",
          "DNSName": "my-load-balancer-424835706.us-west-2.elb.amazonaws.com",
          "SecurityGroups": [
              "sg-5943793c"
          ],
          "LoadBalancerName": "my-load-balancer",
          "State": {
              "Code": "active"
          },
          "LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188"
      }
  ]
}

To describe all load balancers

This example describes all of your load balancers.

Command:

aws elbv2 describe-load-balancers

Output

LoadBalancers -> (list)

Information about the load balancers.

(structure)

Information about a load balancer.

LoadBalancerArn -> (string)

The Amazon Resource Name (ARN) of the load balancer.

DNSName -> (string)

The public DNS name of the load balancer.

CanonicalHostedZoneId -> (string)

The ID of the Amazon Route 53 hosted zone associated with the load balancer.

CreatedTime -> (timestamp)

The date and time the load balancer was created.

LoadBalancerName -> (string)

The name of the load balancer.

Scheme -> (string)

The nodes of an Internet-facing load balancer have public IP addresses. The DNS name of an Internet-facing load balancer is publicly resolvable to the public IP addresses of the nodes. Therefore, Internet-facing load balancers can route requests from clients over the internet.

The nodes of an internal load balancer have only private IP addresses. The DNS name of an internal load balancer is publicly resolvable to the private IP addresses of the nodes. Therefore, internal load balancers can route requests only from clients with access to the VPC for the load balancer.

VpcId -> (string)

The ID of the VPC for the load balancer.

State -> (structure)

The state of the load balancer.

Code -> (string)

The state code. The initial state of the load balancer is provisioning . After the load balancer is fully set up and ready to route traffic, its state is active . If load balancer is routing traffic but does not have the resources it needs to scale, its state is``active_impaired`` . If the load balancer could not be set up, its state is failed .

Reason -> (string)

A description of the state.

Type -> (string)

The type of load balancer.

AvailabilityZones -> (list)

The subnets for the load balancer.

(structure)

Information about an Availability Zone.

ZoneName -> (string)

The name of the Availability Zone.

SubnetId -> (string)

The ID of the subnet. You can specify one subnet per Availability Zone.

OutpostId -> (string)

[Application Load Balancers on Outposts] The ID of the Outpost.

LoadBalancerAddresses -> (list)

[Network Load Balancers] If you need static IP addresses for your load balancer, you can specify one Elastic IP address per Availability Zone when you create an internal-facing load balancer. For internal load balancers, you can specify a private IP address from the IPv4 range of the subnet.

(structure)

Information about a static IP address for a load balancer.

IpAddress -> (string)

The static IP address.

AllocationId -> (string)

[Network Load Balancers] The allocation ID of the Elastic IP address for an internal-facing load balancer.

PrivateIPv4Address -> (string)

[Network Load Balancers] The private IPv4 address for an internal load balancer.

IPv6Address -> (string)

[Network Load Balancers] The IPv6 address.

SourceNatIpv6Prefixes -> (list)

[Network Load Balancers with UDP listeners] The IPv6 prefixes to use for source NAT. For each subnet, specify an IPv6 prefix (/80 netmask) from the subnet CIDR block or auto_assigned to use an IPv6 prefix selected at random from the subnet CIDR block.

(string)

SecurityGroups -> (list)

The IDs of the security groups for the load balancer.

(string)

IpAddressType -> (string)

The type of IP addresses used for public or private connections by the subnets attached to your load balancer.

[Application Load Balancers] The possible values are ipv4 (IPv4 addresses), dualstack (IPv4 and IPv6 addresses), and dualstack-without-public-ipv4 (public IPv6 addresses and private IPv4 and IPv6 addresses).

[Network Load Balancers and Gateway Load Balancers] The possible values are ipv4 (IPv4 addresses) and dualstack (IPv4 and IPv6 addresses).

CustomerOwnedIpv4Pool -> (string)

[Application Load Balancers on Outposts] The ID of the customer-owned address pool.

EnforceSecurityGroupInboundRulesOnPrivateLinkTraffic -> (string)

Indicates whether to evaluate inbound security group rules for traffic sent to a Network Load Balancer through Amazon Web Services PrivateLink.

EnablePrefixForIpv6SourceNat -> (string)

[Network Load Balancers with UDP listeners] Indicates whether to use an IPv6 prefix from each subnet for source NAT. The IP address type must be dualstack . The default value is off .

NextMarker -> (string)

If there are additional results, this is the marker for the next set of results. Otherwise, this is null.