Class: AWS.ELBv2

Inherits:
AWS.Service show all
Identifier:
elbv2
API Version:
2015-12-01
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Sending a Request Using ELBv2

var elbv2 = new AWS.ELBv2();
elbv2.createTargetGroup(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the ELBv2 object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var elbv2 = new AWS.ELBv2({apiVersion: '2015-12-01'});

You can also set the API version globally in AWS.config.apiVersions using the elbv2 service identifier:

AWS.config.apiVersions = {
  elbv2: '2015-12-01',
  // other service API versions
};

var elbv2 = new AWS.ELBv2();

Version:

  • 2015-12-01

Waiter Resource States

This service supports a list of resource states that can be polled using the waitFor() method. The resource states are:

loadBalancerExists, loadBalancerAvailable, loadBalancersDeleted

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, setupRequestListeners, defineService

Constructor Details

new AWS.ELBv2(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a ELBv2 object

var elbv2 = new AWS.ELBv2({apiVersion: '2015-12-01'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com'.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.ELBv2.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.ELBv2.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.ELBv2.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

    whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:

    • min [Boolean] — Validates that a value meets the min constraint. This is enabled by default when paramValidation is set to true.
    • max [Boolean] — Validates that a value meets the max constraint.
    • pattern [Boolean] — Validates that a string value matches a regular expression.
    • enum [Boolean] — Validates that a string value matches one of the allowable enum values.
  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • correctClockSkew (Boolean)

    whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to false.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • s3DisableBodySigning (Boolean)

    whether S3 body signing should be disabled when using signature version v4. Body signing can only be disabled when using https. Defaults to true.

  • retryDelayOptions (map)

    A set of options to configure the retry delay on retryable errors. Currently supported options are:

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and returns the amount of time to delay in milliseconds. The base option will be ignored if this option is supplied.
  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • connectTimeout [Integer] — Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds. This timeout has no effect once a socket connection has been established.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

  • signatureCache (Boolean)

    whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to true.

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

addTags(params = {}, callback) ⇒ AWS.Request

Adds the specified tags to the specified resource. You can tag your Application Load Balancers and your target groups.

Each tag consists of a key and an optional value. If a resource already has a tag with the same key, AddTags updates its value.

To list the current tags for your resources, use DescribeTags. To remove tags from your resources, use RemoveTags.

Service Reference:

Examples:

To add tags to a load balancer


/* This example adds the specified tags to the specified load balancer. */

 var params = {
  ResourceArns: [
     "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188"
  ], 
  Tags: [
     {
    Key: "project", 
    Value: "lima"
   }, 
     {
    Key: "department", 
    Value: "digital-media"
   }
  ]
 };
 elbv2.addTags(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

Calling the addTags operation

var params = {
  ResourceArns: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  Tags: [ /* required */
    {
      Key: 'STRING_VALUE', /* required */
      Value: 'STRING_VALUE'
    },
    /* more items */
  ]
};
elbv2.addTags(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ResourceArns — (Array<String>)

      The Amazon Resource Name (ARN) of the resource.

    • Tags — (Array<map>)

      The tags. Each resource can have a maximum of 10 tags.

      • Keyrequired — (String)

        The key of the tag.

      • Value — (String)

        The value of the tag.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createListener(params = {}, callback) ⇒ AWS.Request

Creates a listener for the specified Application Load Balancer.

You can create up to 10 listeners per load balancer.

To update a listener, use ModifyListener. When you are finished with a listener, you can delete it using DeleteListener. If you are finished with both the listener and the load balancer, you can delete them both using DeleteLoadBalancer.

For more information, see Listeners for Your Application Load Balancers in the Application Load Balancers Guide.

Service Reference:

Examples:

To create an HTTP listener


/* This example creates an HTTP listener for the specified load balancer that forwards requests to the specified target group. */

 var params = {
  DefaultActions: [
     {
    TargetGroupArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", 
    Type: "forward"
   }
  ], 
  LoadBalancerArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188", 
  Port: 80, 
  Protocol: "HTTP"
 };
 elbv2.createListener(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Listeners: [
       {
      DefaultActions: [
         {
        TargetGroupArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", 
        Type: "forward"
       }
      ], 
      ListenerArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2", 
      LoadBalancerArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188", 
      Port: 80, 
      Protocol: "HTTP"
     }
    ]
   }
   */
 });

To create an HTTPS listener


/* This example creates an HTTPS listener for the specified load balancer that forwards requests to the specified target group. Note that you must specify an SSL certificate for an HTTPS listener. You can create and manage certificates using AWS Certificate Manager (ACM). Alternatively, you can create a certificate using SSL/TLS tools, get the certificate signed by a certificate authority (CA), and upload the certificate to AWS Identity and Access Management (IAM). */

 var params = {
  Certificates: [
     {
    CertificateArn: "arn:aws:iam::123456789012:server-certificate/my-server-cert"
   }
  ], 
  DefaultActions: [
     {
    TargetGroupArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", 
    Type: "forward"
   }
  ], 
  LoadBalancerArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188", 
  Port: 443, 
  Protocol: "HTTPS", 
  SslPolicy: "ELBSecurityPolicy-2015-05"
 };
 elbv2.createListener(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Listeners: [
       {
      Certificates: [
         {
        CertificateArn: "arn:aws:iam::123456789012:server-certificate/my-server-cert"
       }
      ], 
      DefaultActions: [
         {
        TargetGroupArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", 
        Type: "forward"
       }
      ], 
      ListenerArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2", 
      LoadBalancerArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188", 
      Port: 443, 
      Protocol: "HTTPS", 
      SslPolicy: "ELBSecurityPolicy-2015-05"
     }
    ]
   }
   */
 });

Calling the createListener operation

var params = {
  DefaultActions: [ /* required */
    {
      TargetGroupArn: 'STRING_VALUE', /* required */
      Type: forward /* required */
    },
    /* more items */
  ],
  LoadBalancerArn: 'STRING_VALUE', /* required */
  Port: 0, /* required */
  Protocol: HTTP | HTTPS, /* required */
  Certificates: [
    {
      CertificateArn: 'STRING_VALUE'
    },
    /* more items */
  ],
  SslPolicy: 'STRING_VALUE'
};
elbv2.createListener(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • LoadBalancerArn — (String)

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

    • Protocol — (String)

      The protocol for connections from clients to the load balancer.

      Possible values include:
      • "HTTP"
      • "HTTPS"
    • Port — (Integer)

      The port on which the load balancer is listening.

    • SslPolicy — (String)

      The security policy that defines which ciphers and protocols are supported. The default is the current predefined security policy.

    • Certificates — (Array<map>)

      The SSL server certificate. You must provide exactly one certificate if the protocol is HTTPS.

      • CertificateArn — (String)

        The Amazon Resource Name (ARN) of the certificate.

    • DefaultActions — (Array<map>)

      The default action for the listener.

      • Typerequired — (String)

        The type of action.

        Possible values include:
        • "forward"
      • TargetGroupArnrequired — (String)

        The Amazon Resource Name (ARN) of the target group.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Listeners — (Array<map>)

        Information about the listener.

        • ListenerArn — (String)

          The Amazon Resource Name (ARN) of the listener.

        • LoadBalancerArn — (String)

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

        • Port — (Integer)

          The port on which the load balancer is listening.

        • Protocol — (String)

          The protocol for connections from clients to the load balancer.

          Possible values include:
          • "HTTP"
          • "HTTPS"
        • Certificates — (Array<map>)

          The SSL server certificate. You must provide a certificate if the protocol is HTTPS.

          • CertificateArn — (String)

            The Amazon Resource Name (ARN) of the certificate.

        • SslPolicy — (String)

          The security policy that defines which ciphers and protocols are supported. The default is the current predefined security policy.

        • DefaultActions — (Array<map>)

          The default actions for the listener.

          • Typerequired — (String)

            The type of action.

            Possible values include:
            • "forward"
          • TargetGroupArnrequired — (String)

            The Amazon Resource Name (ARN) of the target group.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createLoadBalancer(params = {}, callback) ⇒ AWS.Request

Creates an Application Load Balancer.

When you create a load balancer, you can specify security groups, subnets, IP address type, and tags. Otherwise, you could do so later using SetSecurityGroups, SetSubnets, SetIpAddressType, and AddTags.

To create listeners for your load balancer, use CreateListener. To describe your current load balancers, see DescribeLoadBalancers. When you are finished with a load balancer, you can delete it using DeleteLoadBalancer.

You can create up to 20 load balancers per region per account. You can request an increase for the number of load balancers for your account. For more information, see Limits for Your Application Load Balancer in the Application Load Balancers Guide.

For more information, see Application Load Balancers in the Application Load Balancers Guide.

Service Reference:

Examples:

To create an Internet-facing load balancer


/* This example creates an Internet-facing load balancer and enables the Availability Zones for the specified subnets. */

 var params = {
  Name: "my-load-balancer", 
  Subnets: [
     "subnet-b7d581c0", 
     "subnet-8360a9e7"
  ]
 };
 elbv2.createLoadBalancer(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    LoadBalancers: [
       {
      AvailabilityZones: [
         {
        SubnetId: "subnet-8360a9e7", 
        ZoneName: "us-west-2a"
       }, 
         {
        SubnetId: "subnet-b7d581c0", 
        ZoneName: "us-west-2b"
       }
      ], 
      CanonicalHostedZoneId: "Z2P70J7EXAMPLE", 
      CreatedTime: <Date Representation>, 
      DNSName: "my-load-balancer-424835706.us-west-2.elb.amazonaws.com", 
      LoadBalancerArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188", 
      LoadBalancerName: "my-load-balancer", 
      Scheme: "internet-facing", 
      SecurityGroups: [
         "sg-5943793c"
      ], 
      State: {
       Code: "provisioning"
      }, 
      Type: "application", 
      VpcId: "vpc-3ac0fb5f"
     }
    ]
   }
   */
 });

To create an internal load balancer


/* This example creates an internal load balancer and enables the Availability Zones for the specified subnets. */

 var params = {
  Name: "my-internal-load-balancer", 
  Scheme: "internal", 
  SecurityGroups: [
  ], 
  Subnets: [
     "subnet-b7d581c0", 
     "subnet-8360a9e7"
  ]
 };
 elbv2.createLoadBalancer(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    LoadBalancers: [
       {
      AvailabilityZones: [
         {
        SubnetId: "subnet-8360a9e7", 
        ZoneName: "us-west-2a"
       }, 
         {
        SubnetId: "subnet-b7d581c0", 
        ZoneName: "us-west-2b"
       }
      ], 
      CanonicalHostedZoneId: "Z2P70J7EXAMPLE", 
      CreatedTime: <Date Representation>, 
      DNSName: "internal-my-internal-load-balancer-1529930873.us-west-2.elb.amazonaws.com", 
      LoadBalancerArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-internal-load-balancer/5b49b8d4303115c2", 
      LoadBalancerName: "my-internal-load-balancer", 
      Scheme: "internal", 
      SecurityGroups: [
         "sg-5943793c"
      ], 
      State: {
       Code: "provisioning"
      }, 
      Type: "application", 
      VpcId: "vpc-3ac0fb5f"
     }
    ]
   }
   */
 });

Calling the createLoadBalancer operation

var params = {
  Name: 'STRING_VALUE', /* required */
  Subnets: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  IpAddressType: ipv4 | dualstack,
  Scheme: internet-facing | internal,
  SecurityGroups: [
    'STRING_VALUE',
    /* more items */
  ],
  Tags: [
    {
      Key: 'STRING_VALUE', /* required */
      Value: 'STRING_VALUE'
    },
    /* more items */
  ]
};
elbv2.createLoadBalancer(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Name — (String)

      The name of the load balancer.

      This name must be unique per region per account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen.

    • Subnets — (Array<String>)

      The IDs of the subnets to attach to the load balancer. You can specify only one subnet per Availability Zone. You must specify subnets from at least two Availability Zones.

    • SecurityGroups — (Array<String>)

      The IDs of the security groups to assign to 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 only route requests from clients with access to the VPC for the load balancer.

      The default is an Internet-facing load balancer.

      Possible values include:
      • "internet-facing"
      • "internal"
    • Tags — (Array<map>)

      One or more tags to assign to the load balancer.

      • Keyrequired — (String)

        The key of the tag.

      • Value — (String)

        The value of the tag.

    • IpAddressType — (String)

      The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 (for IPv4 addresses) and dualstack (for IPv4 and IPv6 addresses). Internal load balancers must use ipv4.

      Possible values include:
      • "ipv4"
      • "dualstack"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • LoadBalancers — (Array<map>)

        Information about the 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 — (Date)

          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 only route requests from clients with access to the VPC for the load balancer.

          Possible values include:
          • "internet-facing"
          • "internal"
        • VpcId — (String)

          The ID of the VPC for the load balancer.

        • State — (map)

          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 the load balancer could not be set up, its state is failed.

            Possible values include:
            • "active"
            • "provisioning"
            • "failed"
          • Reason — (String)

            A description of the state.

        • Type — (String)

          The type of load balancer.

          Possible values include:
          • "application"
        • AvailabilityZones — (Array<map>)

          The Availability Zones for the load balancer.

          • ZoneName — (String)

            The name of the Availability Zone.

          • SubnetId — (String)

            The ID of the subnet.

        • SecurityGroups — (Array<String>)

          The IDs of the security groups for the load balancer.

        • IpAddressType — (String)

          The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 (for IPv4 addresses) and dualstack (for IPv4 and IPv6 addresses).

          Possible values include:
          • "ipv4"
          • "dualstack"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createRule(params = {}, callback) ⇒ AWS.Request

Creates a rule for the specified listener.

Each rule can have one action and one condition. Rules are evaluated in priority order, from the lowest value to the highest value. When the condition for a rule is met, the specified action is taken. If no conditions are met, the default action for the default rule is taken. For more information, see Listener Rules in the Application Load Balancers Guide.

To view your current rules, use DescribeRules. To update a rule, use ModifyRule. To set the priorities of your rules, use SetRulePriorities. To delete a rule, use DeleteRule.

Service Reference:

Examples:

To create a rule


/* This example creates a rule that forwards requests to the specified target group if the URL contains the specified pattern (for example, /img/*). */

 var params = {
  Actions: [
     {
    TargetGroupArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", 
    Type: "forward"
   }
  ], 
  Conditions: [
     {
    Field: "path-pattern", 
    Values: [
       "/img/*"
    ]
   }
  ], 
  ListenerArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2", 
  Priority: 10
 };
 elbv2.createRule(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Rules: [
       {
      Actions: [
         {
        TargetGroupArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", 
        Type: "forward"
       }
      ], 
      Conditions: [
         {
        Field: "path-pattern", 
        Values: [
           "/img/*"
        ]
       }
      ], 
      IsDefault: false, 
      Priority: "10", 
      RuleArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/9683b2d02a6cabee"
     }
    ]
   }
   */
 });

Calling the createRule operation

var params = {
  Actions: [ /* required */
    {
      TargetGroupArn: 'STRING_VALUE', /* required */
      Type: forward /* required */
    },
    /* more items */
  ],
  Conditions: [ /* required */
    {
      Field: 'STRING_VALUE',
      Values: [
        'STRING_VALUE',
        /* more items */
      ]
    },
    /* more items */
  ],
  ListenerArn: 'STRING_VALUE', /* required */
  Priority: 0 /* required */
};
elbv2.createRule(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ListenerArn — (String)

      The Amazon Resource Name (ARN) of the listener.

    • Conditions — (Array<map>)

      A condition. Each condition specifies a field name and a single value.

      If the field name is host-header, you can specify a single host name (for example, my.example.com). A host name is case insensitive, can be up to 128 characters in length, and can contain any of the following characters. Note that you can include up to three wildcard characters.

      • A-Z, a-z, 0-9

      • - .

      • (matches 0 or more characters)

      • ? (matches exactly 1 character)

      If the field name is path-pattern, you can specify a single path pattern. A path pattern is case sensitive, can be up to 128 characters in length, and can contain any of the following characters. Note that you can include up to three wildcard characters.

      • A-Z, a-z, 0-9

      • _ - . $ / ~ " ' @ : +

      • & (using &amp;)

      • (matches 0 or more characters)

      • ? (matches exactly 1 character)

      • Field — (String)

        The name of the field. The possible values are host-header and path-pattern.

      • Values — (Array<String>)

        The condition value.

        If the field name is host-header, you can specify a single host name (for example, my.example.com). A host name is case insensitive, can be up to 128 characters in length, and can contain any of the following characters. Note that you can include up to three wildcard characters.

        • A-Z, a-z, 0-9

        • - .

        • (matches 0 or more characters)

        • ? (matches exactly 1 character)

        If the field name is path-pattern, you can specify a single path pattern (for example, /img/). A path pattern is case sensitive, can be up to 128 characters in length, and can contain any of the following characters. Note that you can include up to three wildcard characters.

        • A-Z, a-z, 0-9

        • _ - . $ / ~ " ' @ : +

        • & (using &amp;)

        • * (matches 0 or more characters)

        • ? (matches exactly 1 character)

    • Priority — (Integer)

      The priority for the rule. A listener can't have multiple rules with the same priority.

    • Actions — (Array<map>)

      An action. Each action has the type forward and specifies a target group.

      • Typerequired — (String)

        The type of action.

        Possible values include:
        • "forward"
      • TargetGroupArnrequired — (String)

        The Amazon Resource Name (ARN) of the target group.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Rules — (Array<map>)

        Information about the rule.

        • RuleArn — (String)

          The Amazon Resource Name (ARN) of the rule.

        • Priority — (String)

          The priority.

        • Conditions — (Array<map>)

          The conditions.

          • Field — (String)

            The name of the field. The possible values are host-header and path-pattern.

          • Values — (Array<String>)

            The condition value.

            If the field name is host-header, you can specify a single host name (for example, my.example.com). A host name is case insensitive, can be up to 128 characters in length, and can contain any of the following characters. Note that you can include up to three wildcard characters.

            • A-Z, a-z, 0-9

            • - .

            • (matches 0 or more characters)

            • ? (matches exactly 1 character)

            If the field name is path-pattern, you can specify a single path pattern (for example, /img/). A path pattern is case sensitive, can be up to 128 characters in length, and can contain any of the following characters. Note that you can include up to three wildcard characters.

            • A-Z, a-z, 0-9

            • _ - . $ / ~ " ' @ : +

            • & (using &amp;)

            • * (matches 0 or more characters)

            • ? (matches exactly 1 character)

        • Actions — (Array<map>)

          The actions.

          • Typerequired — (String)

            The type of action.

            Possible values include:
            • "forward"
          • TargetGroupArnrequired — (String)

            The Amazon Resource Name (ARN) of the target group.

        • IsDefault — (Boolean)

          Indicates whether this is the default rule.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createTargetGroup(params = {}, callback) ⇒ AWS.Request

Creates a target group.

To register targets with the target group, use RegisterTargets. To update the health check settings for the target group, use ModifyTargetGroup. To monitor the health of targets in the target group, use DescribeTargetHealth.

To route traffic to the targets in a target group, specify the target group in an action using CreateListener or CreateRule.

To delete a target group, use DeleteTargetGroup.

For more information, see Target Groups for Your Application Load Balancers in the Application Load Balancers Guide.

Service Reference:

Examples:

To create a target group


/* This example creates a target group that you can use to route traffic to targets using HTTP on port 80. This target group uses the default health check configuration. */

 var params = {
  Name: "my-targets", 
  Port: 80, 
  Protocol: "HTTP", 
  VpcId: "vpc-3ac0fb5f"
 };
 elbv2.createTargetGroup(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    TargetGroups: [
       {
      HealthCheckIntervalSeconds: 30, 
      HealthCheckPath: "/", 
      HealthCheckPort: "traffic-port", 
      HealthCheckProtocol: "HTTP", 
      HealthCheckTimeoutSeconds: 5, 
      HealthyThresholdCount: 5, 
      Matcher: {
       HttpCode: "200"
      }, 
      Port: 80, 
      Protocol: "HTTP", 
      TargetGroupArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", 
      TargetGroupName: "my-targets", 
      UnhealthyThresholdCount: 2, 
      VpcId: "vpc-3ac0fb5f"
     }
    ]
   }
   */
 });

Calling the createTargetGroup operation

var params = {
  Name: 'STRING_VALUE', /* required */
  Port: 0, /* required */
  Protocol: HTTP | HTTPS, /* required */
  VpcId: 'STRING_VALUE', /* required */
  HealthCheckIntervalSeconds: 0,
  HealthCheckPath: 'STRING_VALUE',
  HealthCheckPort: 'STRING_VALUE',
  HealthCheckProtocol: HTTP | HTTPS,
  HealthCheckTimeoutSeconds: 0,
  HealthyThresholdCount: 0,
  Matcher: {
    HttpCode: 'STRING_VALUE' /* required */
  },
  UnhealthyThresholdCount: 0
};
elbv2.createTargetGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Name — (String)

      The name of the target group.

      This name must be unique per region per account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen.

    • Protocol — (String)

      The protocol to use for routing traffic to the targets.

      Possible values include:
      • "HTTP"
      • "HTTPS"
    • Port — (Integer)

      The port on which the targets receive traffic. This port is used unless you specify a port override when registering the target.

    • VpcId — (String)

      The identifier of the virtual private cloud (VPC).

    • HealthCheckProtocol — (String)

      The protocol the load balancer uses when performing health checks on targets. The default is the HTTP protocol.

      Possible values include:
      • "HTTP"
      • "HTTPS"
    • HealthCheckPort — (String)

      The port the load balancer uses when performing health checks on targets. The default is traffic-port, which indicates the port on which each target receives traffic from the load balancer.

    • HealthCheckPath — (String)

      The ping path that is the destination on the targets for health checks. The default is /.

    • HealthCheckIntervalSeconds — (Integer)

      The approximate amount of time, in seconds, between health checks of an individual target. The default is 30 seconds.

    • HealthCheckTimeoutSeconds — (Integer)

      The amount of time, in seconds, during which no response from a target means a failed health check. The default is 5 seconds.

    • HealthyThresholdCount — (Integer)

      The number of consecutive health checks successes required before considering an unhealthy target healthy. The default is 5.

    • UnhealthyThresholdCount — (Integer)

      The number of consecutive health check failures required before considering a target unhealthy. The default is 2.

    • Matcher — (map)

      The HTTP codes to use when checking for a successful response from a target. The default is 200.

      • HttpCoderequired — (String)

        The HTTP codes. You can specify values between 200 and 499. The default value is 200. You can specify multiple values (for example, "200,202") or a range of values (for example, "200-299").

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • TargetGroups — (Array<map>)

        Information about the target group.

        • TargetGroupArn — (String)

          The Amazon Resource Name (ARN) of the target group.

        • TargetGroupName — (String)

          The name of the target group.

        • Protocol — (String)

          The protocol to use for routing traffic to the targets.

          Possible values include:
          • "HTTP"
          • "HTTPS"
        • Port — (Integer)

          The port on which the targets are listening.

        • VpcId — (String)

          The ID of the VPC for the targets.

        • HealthCheckProtocol — (String)

          The protocol to use to connect with the target.

          Possible values include:
          • "HTTP"
          • "HTTPS"
        • HealthCheckPort — (String)

          The port to use to connect with the target.

        • HealthCheckIntervalSeconds — (Integer)

          The approximate amount of time, in seconds, between health checks of an individual target.

        • HealthCheckTimeoutSeconds — (Integer)

          The amount of time, in seconds, during which no response means a failed health check.

        • HealthyThresholdCount — (Integer)

          The number of consecutive health checks successes required before considering an unhealthy target healthy.

        • UnhealthyThresholdCount — (Integer)

          The number of consecutive health check failures required before considering the target unhealthy.

        • HealthCheckPath — (String)

          The destination for the health check request.

        • Matcher — (map)

          The HTTP codes to use when checking for a successful response from a target.

          • HttpCoderequired — (String)

            The HTTP codes. You can specify values between 200 and 499. The default value is 200. You can specify multiple values (for example, "200,202") or a range of values (for example, "200-299").

        • LoadBalancerArns — (Array<String>)

          The Amazon Resource Names (ARN) of the load balancers that route traffic to this target group.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteListener(params = {}, callback) ⇒ AWS.Request

Deletes the specified listener.

Alternatively, your listener is deleted when you delete the load balancer it is attached to using DeleteLoadBalancer.

Service Reference:

Examples:

To delete a listener


/* This example deletes the specified listener. */

 var params = {
  ListenerArn: "arn:aws:elasticloadbalancing:ua-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2"
 };
 elbv2.deleteListener(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

Calling the deleteListener operation

var params = {
  ListenerArn: 'STRING_VALUE' /* required */
};
elbv2.deleteListener(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ListenerArn — (String)

      The Amazon Resource Name (ARN) of the listener.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteLoadBalancer(params = {}, callback) ⇒ AWS.Request

Deletes the specified Application Load Balancer and its attached listeners.

You can't delete a load balancer if deletion protection is enabled. If the load balancer does not exist or has already been deleted, the call succeeds.

Deleting a load balancer does not affect its registered targets. For example, your EC2 instances continue to run and are still registered to their target groups. If you no longer need these EC2 instances, you can stop or terminate them.

Service Reference:

Examples:

To delete a load balancer


/* This example deletes the specified load balancer. */

 var params = {
  LoadBalancerArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188"
 };
 elbv2.deleteLoadBalancer(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

Calling the deleteLoadBalancer operation

var params = {
  LoadBalancerArn: 'STRING_VALUE' /* required */
};
elbv2.deleteLoadBalancer(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • LoadBalancerArn — (String)

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

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteRule(params = {}, callback) ⇒ AWS.Request

Deletes the specified rule.

Service Reference:

Examples:

To delete a rule


/* This example deletes the specified rule. */

 var params = {
  RuleArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/1291d13826f405c3"
 };
 elbv2.deleteRule(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

Calling the deleteRule operation

var params = {
  RuleArn: 'STRING_VALUE' /* required */
};
elbv2.deleteRule(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • RuleArn — (String)

      The Amazon Resource Name (ARN) of the rule.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteTargetGroup(params = {}, callback) ⇒ AWS.Request

Deletes the specified target group.

You can delete a target group if it is not referenced by any actions. Deleting a target group also deletes any associated health checks.

Service Reference:

Examples:

To delete a target group


/* This example deletes the specified target group. */

 var params = {
  TargetGroupArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067"
 };
 elbv2.deleteTargetGroup(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

Calling the deleteTargetGroup operation

var params = {
  TargetGroupArn: 'STRING_VALUE' /* required */
};
elbv2.deleteTargetGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • TargetGroupArn — (String)

      The Amazon Resource Name (ARN) of the target group.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deregisterTargets(params = {}, callback) ⇒ AWS.Request

Deregisters the specified targets from the specified target group. After the targets are deregistered, they no longer receive traffic from the load balancer.

Service Reference:

Examples:

To deregister a target from a target group


/* This example deregisters the specified instance from the specified target group. */

 var params = {
  TargetGroupArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", 
  Targets: [
     {
    Id: "i-0f76fade"
   }
  ]
 };
 elbv2.deregisterTargets(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

Calling the deregisterTargets operation

var params = {
  TargetGroupArn: 'STRING_VALUE', /* required */
  Targets: [ /* required */
    {
      Id: 'STRING_VALUE', /* required */
      Port: 0
    },
    /* more items */
  ]
};
elbv2.deregisterTargets(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • TargetGroupArn — (String)

      The Amazon Resource Name (ARN) of the target group.

    • Targets — (Array<map>)

      The targets. If you specified a port override when you registered a target, you must specify both the target ID and the port when you deregister it.

      • Idrequired — (String)

        The ID of the target.

      • Port — (Integer)

        The port on which the target is listening.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeListeners(params = {}, callback) ⇒ AWS.Request

Describes the specified listeners or the listeners for the specified Application Load Balancer. You must specify either a load balancer or one or more listeners.

Service Reference:

Examples:

To describe a listener


/* This example describes the specified listener. */

 var params = {
  ListenerArns: [
     "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2"
  ]
 };
 elbv2.describeListeners(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Listeners: [
       {
      DefaultActions: [
         {
        TargetGroupArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", 
        Type: "forward"
       }
      ], 
      ListenerArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2", 
      LoadBalancerArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188", 
      Port: 80, 
      Protocol: "HTTP"
     }
    ]
   }
   */
 });

Calling the describeListeners operation

var params = {
  ListenerArns: [
    'STRING_VALUE',
    /* more items */
  ],
  LoadBalancerArn: 'STRING_VALUE',
  Marker: 'STRING_VALUE',
  PageSize: 0
};
elbv2.describeListeners(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • LoadBalancerArn — (String)

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

    • ListenerArns — (Array<String>)

      The Amazon Resource Names (ARN) of the listeners.

    • Marker — (String)

      The marker for the next set of results. (You received this marker from a previous call.)

    • PageSize — (Integer)

      The maximum number of results to return with this call.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Listeners — (Array<map>)

        Information about the listeners.

        • ListenerArn — (String)

          The Amazon Resource Name (ARN) of the listener.

        • LoadBalancerArn — (String)

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

        • Port — (Integer)

          The port on which the load balancer is listening.

        • Protocol — (String)

          The protocol for connections from clients to the load balancer.

          Possible values include:
          • "HTTP"
          • "HTTPS"
        • Certificates — (Array<map>)

          The SSL server certificate. You must provide a certificate if the protocol is HTTPS.

          • CertificateArn — (String)

            The Amazon Resource Name (ARN) of the certificate.

        • SslPolicy — (String)

          The security policy that defines which ciphers and protocols are supported. The default is the current predefined security policy.

        • DefaultActions — (Array<map>)

          The default actions for the listener.

          • Typerequired — (String)

            The type of action.

            Possible values include:
            • "forward"
          • TargetGroupArnrequired — (String)

            The Amazon Resource Name (ARN) of the target group.

      • NextMarker — (String)

        The marker to use when requesting the next set of results. If there are no additional results, the string is empty.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeLoadBalancerAttributes(params = {}, callback) ⇒ AWS.Request

Describes the attributes for the specified Application Load Balancer.

Service Reference:

Examples:

To describe load balancer attributes


/* This example describes the attributes of the specified load balancer. */

 var params = {
  LoadBalancerArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188"
 };
 elbv2.describeLoadBalancerAttributes(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Attributes: [
       {
      Key: "access_logs.s3.enabled", 
      Value: "false"
     }, 
       {
      Key: "idle_timeout.timeout_seconds", 
      Value: "60"
     }, 
       {
      Key: "access_logs.s3.prefix", 
      Value: ""
     }, 
       {
      Key: "deletion_protection.enabled", 
      Value: "false"
     }, 
       {
      Key: "access_logs.s3.bucket", 
      Value: ""
     }
    ]
   }
   */
 });

Calling the describeLoadBalancerAttributes operation

var params = {
  LoadBalancerArn: 'STRING_VALUE' /* required */
};
elbv2.describeLoadBalancerAttributes(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • LoadBalancerArn — (String)

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

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Attributes — (Array<map>)

        Information about the load balancer attributes.

        • Key — (String)

          The name of the attribute.

          • access_logs.s3.enabled - Indicates whether access logs stored in Amazon S3 are enabled. The value is true or false.

          • access_logs.s3.bucket - The name of the S3 bucket for the access logs. This attribute is required if access logs in Amazon S3 are enabled. The bucket must exist in the same region as the load balancer and have a bucket policy that grants Elastic Load Balancing permission to write to the bucket.

          • access_logs.s3.prefix - The prefix for the location in the S3 bucket. If you don't specify a prefix, the access logs are stored in the root of the bucket.

          • deletion_protection.enabled - Indicates whether deletion protection is enabled. The value is true or false.

          • idle_timeout.timeout_seconds - The idle timeout value, in seconds. The valid range is 1-3600. The default is 60 seconds.

        • Value — (String)

          The value of the attribute.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeLoadBalancers(params = {}, callback) ⇒ AWS.Request

Describes the specified Application Load Balancers or all of your Application Load Balancers.

To describe the listeners for a load balancer, use DescribeListeners. To describe the attributes for a load balancer, use DescribeLoadBalancerAttributes.

Service Reference:

Examples:

To describe a load balancer


/* This example describes the specified load balancer. */

 var params = {
  LoadBalancerArns: [
     "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188"
  ]
 };
 elbv2.describeLoadBalancers(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    LoadBalancers: [
       {
      AvailabilityZones: [
         {
        SubnetId: "subnet-8360a9e7", 
        ZoneName: "us-west-2a"
       }, 
         {
        SubnetId: "subnet-b7d581c0", 
        ZoneName: "us-west-2b"
       }
      ], 
      CanonicalHostedZoneId: "Z2P70J7EXAMPLE", 
      CreatedTime: <Date Representation>, 
      DNSName: "my-load-balancer-424835706.us-west-2.elb.amazonaws.com", 
      LoadBalancerArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188", 
      LoadBalancerName: "my-load-balancer", 
      Scheme: "internet-facing", 
      SecurityGroups: [
         "sg-5943793c"
      ], 
      State: {
       Code: "active"
      }, 
      Type: "application", 
      VpcId: "vpc-3ac0fb5f"
     }
    ]
   }
   */
 });

Calling the describeLoadBalancers operation

var params = {
  LoadBalancerArns: [
    'STRING_VALUE',
    /* more items */
  ],
  Marker: 'STRING_VALUE',
  Names: [
    'STRING_VALUE',
    /* more items */
  ],
  PageSize: 0
};
elbv2.describeLoadBalancers(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • LoadBalancerArns — (Array<String>)

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

    • Names — (Array<String>)

      The names of the load balancers.

    • Marker — (String)

      The marker for the next set of results. (You received this marker from a previous call.)

    • PageSize — (Integer)

      The maximum number of results to return with this call.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • LoadBalancers — (Array<map>)

        Information about the load balancers.

        • 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 — (Date)

          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 only route requests from clients with access to the VPC for the load balancer.

          Possible values include:
          • "internet-facing"
          • "internal"
        • VpcId — (String)

          The ID of the VPC for the load balancer.

        • State — (map)

          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 the load balancer could not be set up, its state is failed.

            Possible values include:
            • "active"
            • "provisioning"
            • "failed"
          • Reason — (String)

            A description of the state.

        • Type — (String)

          The type of load balancer.

          Possible values include:
          • "application"
        • AvailabilityZones — (Array<map>)

          The Availability Zones for the load balancer.

          • ZoneName — (String)

            The name of the Availability Zone.

          • SubnetId — (String)

            The ID of the subnet.

        • SecurityGroups — (Array<String>)

          The IDs of the security groups for the load balancer.

        • IpAddressType — (String)

          The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 (for IPv4 addresses) and dualstack (for IPv4 and IPv6 addresses).

          Possible values include:
          • "ipv4"
          • "dualstack"
      • NextMarker — (String)

        The marker to use when requesting the next set of results. If there are no additional results, the string is empty.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

Waiter Resource States:

describeRules(params = {}, callback) ⇒ AWS.Request

Describes the specified rules or the rules for the specified listener. You must specify either a listener or one or more rules.

Service Reference:

Examples:

To describe a rule


/* This example describes the specified rule. */

 var params = {
  RuleArns: [
     "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/9683b2d02a6cabee"
  ]
 };
 elbv2.describeRules(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Rules: [
       {
      Actions: [
         {
        TargetGroupArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", 
        Type: "forward"
       }
      ], 
      Conditions: [
         {
        Field: "path-pattern", 
        Values: [
           "/img/*"
        ]
       }
      ], 
      IsDefault: false, 
      Priority: "10", 
      RuleArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/9683b2d02a6cabee"
     }
    ]
   }
   */
 });

Calling the describeRules operation

var params = {
  ListenerArn: 'STRING_VALUE',
  RuleArns: [
    'STRING_VALUE',
    /* more items */
  ]
};
elbv2.describeRules(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ListenerArn — (String)

      The Amazon Resource Name (ARN) of the listener.

    • RuleArns — (Array<String>)

      The Amazon Resource Names (ARN) of the rules.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Rules — (Array<map>)

        Information about the rules.

        • RuleArn — (String)

          The Amazon Resource Name (ARN) of the rule.

        • Priority — (String)

          The priority.

        • Conditions — (Array<map>)

          The conditions.

          • Field — (String)

            The name of the field. The possible values are host-header and path-pattern.

          • Values — (Array<String>)

            The condition value.

            If the field name is host-header, you can specify a single host name (for example, my.example.com). A host name is case insensitive, can be up to 128 characters in length, and can contain any of the following characters. Note that you can include up to three wildcard characters.

            • A-Z, a-z, 0-9

            • - .

            • (matches 0 or more characters)

            • ? (matches exactly 1 character)

            If the field name is path-pattern, you can specify a single path pattern (for example, /img/). A path pattern is case sensitive, can be up to 128 characters in length, and can contain any of the following characters. Note that you can include up to three wildcard characters.

            • A-Z, a-z, 0-9

            • _ - . $ / ~ " ' @ : +

            • & (using &amp;)

            • * (matches 0 or more characters)

            • ? (matches exactly 1 character)

        • Actions — (Array<map>)

          The actions.

          • Typerequired — (String)

            The type of action.

            Possible values include:
            • "forward"
          • TargetGroupArnrequired — (String)

            The Amazon Resource Name (ARN) of the target group.

        • IsDefault — (Boolean)

          Indicates whether this is the default rule.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeSSLPolicies(params = {}, callback) ⇒ AWS.Request

Describes the specified policies or all policies used for SSL negotiation.

For more information, see Security Policies in the Application Load Balancers Guide.

Service Reference:

Examples:

To describe a policy used for SSL negotiation


/* This example describes the specified policy used for SSL negotiation. */

 var params = {
  Names: [
     "ELBSecurityPolicy-2015-05"
  ]
 };
 elbv2.describeSSLPolicies(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    SslPolicies: [
       {
      Ciphers: [
         {
        Name: "ECDHE-ECDSA-AES128-GCM-SHA256", 
        Priority: 1
       }, 
         {
        Name: "ECDHE-RSA-AES128-GCM-SHA256", 
        Priority: 2
       }, 
         {
        Name: "ECDHE-ECDSA-AES128-SHA256", 
        Priority: 3
       }, 
         {
        Name: "ECDHE-RSA-AES128-SHA256", 
        Priority: 4
       }, 
         {
        Name: "ECDHE-ECDSA-AES128-SHA", 
        Priority: 5
       }, 
         {
        Name: "ECDHE-RSA-AES128-SHA", 
        Priority: 6
       }, 
         {
        Name: "DHE-RSA-AES128-SHA", 
        Priority: 7
       }, 
         {
        Name: "ECDHE-ECDSA-AES256-GCM-SHA384", 
        Priority: 8
       }, 
         {
        Name: "ECDHE-RSA-AES256-GCM-SHA384", 
        Priority: 9
       }, 
         {
        Name: "ECDHE-ECDSA-AES256-SHA384", 
        Priority: 10
       }, 
         {
        Name: "ECDHE-RSA-AES256-SHA384", 
        Priority: 11
       }, 
         {
        Name: "ECDHE-RSA-AES256-SHA", 
        Priority: 12
       }, 
         {
        Name: "ECDHE-ECDSA-AES256-SHA", 
        Priority: 13
       }, 
         {
        Name: "AES128-GCM-SHA256", 
        Priority: 14
       }, 
         {
        Name: "AES128-SHA256", 
        Priority: 15
       }, 
         {
        Name: "AES128-SHA", 
        Priority: 16
       }, 
         {
        Name: "AES256-GCM-SHA384", 
        Priority: 17
       }, 
         {
        Name: "AES256-SHA256", 
        Priority: 18
       }, 
         {
        Name: "AES256-SHA", 
        Priority: 19
       }
      ], 
      Name: "ELBSecurityPolicy-2015-05", 
      SslProtocols: [
         "TLSv1", 
         "TLSv1.1", 
         "TLSv1.2"
      ]
     }
    ]
   }
   */
 });

Calling the describeSSLPolicies operation

var params = {
  Marker: 'STRING_VALUE',
  Names: [
    'STRING_VALUE',
    /* more items */
  ],
  PageSize: 0
};
elbv2.describeSSLPolicies(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Names — (Array<String>)

      The names of the policies.

    • Marker — (String)

      The marker for the next set of results. (You received this marker from a previous call.)

    • PageSize — (Integer)

      The maximum number of results to return with this call.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • SslPolicies — (Array<map>)

        Information about the policies.

        • SslProtocols — (Array<String>)

          The protocols.

        • Ciphers — (Array<map>)

          The ciphers.

          • Name — (String)

            The name of the cipher.

          • Priority — (Integer)

            The priority of the cipher.

        • Name — (String)

          The name of the policy.

      • NextMarker — (String)

        The marker to use when requesting the next set of results. If there are no additional results, the string is empty.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeTags(params = {}, callback) ⇒ AWS.Request

Describes the tags for the specified resources. You can describe the tags for one or more Application Load Balancers and target groups.

Service Reference:

Examples:

To describe the tags assigned to a load balancer


/* This example describes the tags assigned to the specified load balancer. */

 var params = {
  ResourceArns: [
     "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188"
  ]
 };
 elbv2.describeTags(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    TagDescriptions: [
       {
      ResourceArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188", 
      Tags: [
         {
        Key: "project", 
        Value: "lima"
       }, 
         {
        Key: "department", 
        Value: "digital-media"
       }
      ]
     }
    ]
   }
   */
 });

Calling the describeTags operation

var params = {
  ResourceArns: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
elbv2.describeTags(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ResourceArns — (Array<String>)

      The Amazon Resource Names (ARN) of the resources.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • TagDescriptions — (Array<map>)

        Information about the tags.

        • ResourceArn — (String)

          The Amazon Resource Name (ARN) of the resource.

        • Tags — (Array<map>)

          Information about the tags.

          • Keyrequired — (String)

            The key of the tag.

          • Value — (String)

            The value of the tag.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeTargetGroupAttributes(params = {}, callback) ⇒ AWS.Request

Describes the attributes for the specified target group.

Service Reference:

Examples:

To describe target group attributes


/* This example describes the attributes of the specified target group. */

 var params = {
  TargetGroupArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067"
 };
 elbv2.describeTargetGroupAttributes(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Attributes: [
       {
      Key: "stickiness.enabled", 
      Value: "false"
     }, 
       {
      Key: "deregistration_delay.timeout_seconds", 
      Value: "300"
     }, 
       {
      Key: "stickiness.type", 
      Value: "lb_cookie"
     }, 
       {
      Key: "stickiness.lb_cookie.duration_seconds", 
      Value: "86400"
     }
    ]
   }
   */
 });

Calling the describeTargetGroupAttributes operation

var params = {
  TargetGroupArn: 'STRING_VALUE' /* required */
};
elbv2.describeTargetGroupAttributes(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • TargetGroupArn — (String)

      The Amazon Resource Name (ARN) of the target group.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Attributes — (Array<map>)

        Information about the target group attributes

        • Key — (String)

          The name of the attribute.

          • deregistration_delay.timeout_seconds - The amount time for Elastic Load Balancing to wait before changing the state of a deregistering target from draining to unused. The range is 0-3600 seconds. The default value is 300 seconds.

          • stickiness.enabled - Indicates whether sticky sessions are enabled. The value is true or false.

          • stickiness.type - The type of sticky sessions. The possible value is lb_cookie.

          • stickiness.lb_cookie.duration_seconds - The time period, in seconds, during which requests from a client should be routed to the same target. After this time period expires, the load balancer-generated cookie is considered stale. The range is 1 second to 1 week (604800 seconds). The default value is 1 day (86400 seconds).

        • Value — (String)

          The value of the attribute.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeTargetGroups(params = {}, callback) ⇒ AWS.Request

Describes the specified target groups or all of your target groups. By default, all target groups are described. Alternatively, you can specify one of the following to filter the results: the ARN of the load balancer, the names of one or more target groups, or the ARNs of one or more target groups.

To describe the targets for a target group, use DescribeTargetHealth. To describe the attributes of a target group, use DescribeTargetGroupAttributes.

Service Reference:

Examples:

To describe a target group


/* This example describes the specified target group. */

 var params = {
  TargetGroupArns: [
     "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067"
  ]
 };
 elbv2.describeTargetGroups(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    TargetGroups: [
       {
      HealthCheckIntervalSeconds: 30, 
      HealthCheckPath: "/", 
      HealthCheckPort: "traffic-port", 
      HealthCheckProtocol: "HTTP", 
      HealthCheckTimeoutSeconds: 5, 
      HealthyThresholdCount: 5, 
      LoadBalancerArns: [
         "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188"
      ], 
      Matcher: {
       HttpCode: "200"
      }, 
      Port: 80, 
      Protocol: "HTTP", 
      TargetGroupArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", 
      TargetGroupName: "my-targets", 
      UnhealthyThresholdCount: 2, 
      VpcId: "vpc-3ac0fb5f"
     }
    ]
   }
   */
 });

Calling the describeTargetGroups operation

var params = {
  LoadBalancerArn: 'STRING_VALUE',
  Marker: 'STRING_VALUE',
  Names: [
    'STRING_VALUE',
    /* more items */
  ],
  PageSize: 0,
  TargetGroupArns: [
    'STRING_VALUE',
    /* more items */
  ]
};
elbv2.describeTargetGroups(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • LoadBalancerArn — (String)

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

    • TargetGroupArns — (Array<String>)

      The Amazon Resource Names (ARN) of the target groups.

    • Names — (Array<String>)

      The names of the target groups.

    • Marker — (String)

      The marker for the next set of results. (You received this marker from a previous call.)

    • PageSize — (Integer)

      The maximum number of results to return with this call.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • TargetGroups — (Array<map>)

        Information about the target groups.

        • TargetGroupArn — (String)

          The Amazon Resource Name (ARN) of the target group.

        • TargetGroupName — (String)

          The name of the target group.

        • Protocol — (String)

          The protocol to use for routing traffic to the targets.

          Possible values include:
          • "HTTP"
          • "HTTPS"
        • Port — (Integer)

          The port on which the targets are listening.

        • VpcId — (String)

          The ID of the VPC for the targets.

        • HealthCheckProtocol — (String)

          The protocol to use to connect with the target.

          Possible values include:
          • "HTTP"
          • "HTTPS"
        • HealthCheckPort — (String)

          The port to use to connect with the target.

        • HealthCheckIntervalSeconds — (Integer)

          The approximate amount of time, in seconds, between health checks of an individual target.

        • HealthCheckTimeoutSeconds — (Integer)

          The amount of time, in seconds, during which no response means a failed health check.

        • HealthyThresholdCount — (Integer)

          The number of consecutive health checks successes required before considering an unhealthy target healthy.

        • UnhealthyThresholdCount — (Integer)

          The number of consecutive health check failures required before considering the target unhealthy.

        • HealthCheckPath — (String)

          The destination for the health check request.

        • Matcher — (map)

          The HTTP codes to use when checking for a successful response from a target.

          • HttpCoderequired — (String)

            The HTTP codes. You can specify values between 200 and 499. The default value is 200. You can specify multiple values (for example, "200,202") or a range of values (for example, "200-299").

        • LoadBalancerArns — (Array<String>)

          The Amazon Resource Names (ARN) of the load balancers that route traffic to this target group.

      • NextMarker — (String)

        The marker to use when requesting the next set of results. If there are no additional results, the string is empty.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeTargetHealth(params = {}, callback) ⇒ AWS.Request

Describes the health of the specified targets or all of your targets.

Service Reference:

Examples:

To describe the health of the targets for a target group


/* This example describes the health of the targets for the specified target group. One target is healthy but the other is not specified in an action, so it can't receive traffic from the load balancer. */

 var params = {
  TargetGroupArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067"
 };
 elbv2.describeTargetHealth(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    TargetHealthDescriptions: [
       {
      Target: {
       Id: "i-0f76fade", 
       Port: 80
      }, 
      TargetHealth: {
       Description: "Given target group is not configured to receive traffic from ELB", 
       Reason: "Target.NotInUse", 
       State: "unused"
      }
     }, 
       {
      HealthCheckPort: "80", 
      Target: {
       Id: "i-0f76fade", 
       Port: 80
      }, 
      TargetHealth: {
       State: "healthy"
      }
     }
    ]
   }
   */
 });

To describe the health of a target


/* This example describes the health of the specified target. This target is healthy. */

 var params = {
  TargetGroupArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", 
  Targets: [
     {
    Id: "i-0f76fade", 
    Port: 80
   }
  ]
 };
 elbv2.describeTargetHealth(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    TargetHealthDescriptions: [
       {
      HealthCheckPort: "80", 
      Target: {
       Id: "i-0f76fade", 
       Port: 80
      }, 
      TargetHealth: {
       State: "healthy"
      }
     }
    ]
   }
   */
 });

Calling the describeTargetHealth operation

var params = {
  TargetGroupArn: 'STRING_VALUE', /* required */
  Targets: [
    {
      Id: 'STRING_VALUE', /* required */
      Port: 0
    },
    /* more items */
  ]
};
elbv2.describeTargetHealth(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • TargetGroupArn — (String)

      The Amazon Resource Name (ARN) of the target group.

    • Targets — (Array<map>)

      The targets.

      • Idrequired — (String)

        The ID of the target.

      • Port — (Integer)

        The port on which the target is listening.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • TargetHealthDescriptions — (Array<map>)

        Information about the health of the targets.

        • Target — (map)

          The description of the target.

          • Idrequired — (String)

            The ID of the target.

          • Port — (Integer)

            The port on which the target is listening.

        • HealthCheckPort — (String)

          The port to use to connect with the target.

        • TargetHealth — (map)

          The health information for the target.

          • State — (String)

            The state of the target.

            Possible values include:
            • "initial"
            • "healthy"
            • "unhealthy"
            • "unused"
            • "draining"
          • Reason — (String)

            The reason code. If the target state is healthy, a reason code is not provided.

            If the target state is initial, the reason code can be one of the following values:

            • Elb.RegistrationInProgress - The target is in the process of being registered with the load balancer.

            • Elb.InitialHealthChecking - The load balancer is still sending the target the minimum number of health checks required to determine its health status.

            If the target state is unhealthy, the reason code can be one of the following values:

            • Target.ResponseCodeMismatch - The health checks did not return an expected HTTP code.

            • Target.Timeout - The health check requests timed out.

            • Target.FailedHealthChecks - The health checks failed because the connection to the target timed out, the target response was malformed, or the target failed the health check for an unknown reason.

            • Elb.InternalError - The health checks failed due to an internal error.

            If the target state is unused, the reason code can be one of the following values:

            • Target.NotRegistered - The target is not registered with the target group.

            • Target.NotInUse - The target group is not used by any load balancer or the target is in an Availability Zone that is not enabled for its load balancer.

            • Target.InvalidState - The target is in the stopped or terminated state.

            If the target state is draining, the reason code can be the following value:

            • Target.DeregistrationInProgress - The target is in the process of being deregistered and the deregistration delay period has not expired.

            Possible values include:
            • "Elb.RegistrationInProgress"
            • "Elb.InitialHealthChecking"
            • "Target.ResponseCodeMismatch"
            • "Target.Timeout"
            • "Target.FailedHealthChecks"
            • "Target.NotRegistered"
            • "Target.NotInUse"
            • "Target.DeregistrationInProgress"
            • "Target.InvalidState"
            • "Elb.InternalError"
          • Description — (String)

            A description of the target health that provides additional details. If the state is healthy, a description is not provided.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

modifyListener(params = {}, callback) ⇒ AWS.Request

Modifies the specified properties of the specified listener.

Any properties that you do not specify retain their current values. However, changing the protocol from HTTPS to HTTP removes the security policy and SSL certificate properties. If you change the protocol from HTTP to HTTPS, you must add the security policy and server certificate.

Service Reference:

Examples:

To change the default action for a listener


/* This example changes the default action for the specified listener. */

 var params = {
  DefaultActions: [
     {
    TargetGroupArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-new-targets/2453ed029918f21f", 
    Type: "forward"
   }
  ], 
  ListenerArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2"
 };
 elbv2.modifyListener(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Listeners: [
       {
      DefaultActions: [
         {
        TargetGroupArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-new-targets/2453ed029918f21f", 
        Type: "forward"
       }
      ], 
      ListenerArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2", 
      LoadBalancerArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188", 
      Port: 80, 
      Protocol: "HTTP"
     }
    ]
   }
   */
 });

To change the server certificate


/* This example changes the server certificate for the specified HTTPS listener. */

 var params = {
  Certificates: [
     {
    CertificateArn: "arn:aws:iam::123456789012:server-certificate/my-new-server-cert"
   }
  ], 
  ListenerArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/0467ef3c8400ae65"
 };
 elbv2.modifyListener(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Listeners: [
       {
      Certificates: [
         {
        CertificateArn: "arn:aws:iam::123456789012:server-certificate/my-new-server-cert"
       }
      ], 
      DefaultActions: [
         {
        TargetGroupArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", 
        Type: "forward"
       }
      ], 
      ListenerArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/0467ef3c8400ae65", 
      LoadBalancerArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188", 
      Port: 443, 
      Protocol: "HTTPS", 
      SslPolicy: "ELBSecurityPolicy-2015-05"
     }
    ]
   }
   */
 });

Calling the modifyListener operation

var params = {
  ListenerArn: 'STRING_VALUE', /* required */
  Certificates: [
    {
      CertificateArn: 'STRING_VALUE'
    },
    /* more items */
  ],
  DefaultActions: [
    {
      TargetGroupArn: 'STRING_VALUE', /* required */
      Type: forward /* required */
    },
    /* more items */
  ],
  Port: 0,
  Protocol: HTTP | HTTPS,
  SslPolicy: 'STRING_VALUE'
};
elbv2.modifyListener(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ListenerArn — (String)

      The Amazon Resource Name (ARN) of the listener.

    • Port — (Integer)

      The port for connections from clients to the load balancer.

    • Protocol — (String)

      The protocol for connections from clients to the load balancer.

      Possible values include:
      • "HTTP"
      • "HTTPS"
    • SslPolicy — (String)

      The security policy that defines which protocols and ciphers are supported. For more information, see Security Policies in the Application Load Balancers Guide.

    • Certificates — (Array<map>)

      The SSL server certificate.

      • CertificateArn — (String)

        The Amazon Resource Name (ARN) of the certificate.

    • DefaultActions — (Array<map>)

      The default actions.

      • Typerequired — (String)

        The type of action.

        Possible values include:
        • "forward"
      • TargetGroupArnrequired — (String)

        The Amazon Resource Name (ARN) of the target group.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Listeners — (Array<map>)

        Information about the modified listeners.

        • ListenerArn — (String)

          The Amazon Resource Name (ARN) of the listener.

        • LoadBalancerArn — (String)

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

        • Port — (Integer)

          The port on which the load balancer is listening.

        • Protocol — (String)

          The protocol for connections from clients to the load balancer.

          Possible values include:
          • "HTTP"
          • "HTTPS"
        • Certificates — (Array<map>)

          The SSL server certificate. You must provide a certificate if the protocol is HTTPS.

          • CertificateArn — (String)

            The Amazon Resource Name (ARN) of the certificate.

        • SslPolicy — (String)

          The security policy that defines which ciphers and protocols are supported. The default is the current predefined security policy.

        • DefaultActions — (Array<map>)

          The default actions for the listener.

          • Typerequired — (String)

            The type of action.

            Possible values include:
            • "forward"
          • TargetGroupArnrequired — (String)

            The Amazon Resource Name (ARN) of the target group.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

modifyLoadBalancerAttributes(params = {}, callback) ⇒ AWS.Request

Modifies the specified attributes of the specified Application Load Balancer.

If any of the specified attributes can't be modified as requested, the call fails. Any existing attributes that you do not modify retain their current values.

Service Reference:

Examples:

To enable deletion protection


/* This example enables deletion protection for the specified load balancer. */

 var params = {
  Attributes: [
     {
    Key: "deletion_protection.enabled", 
    Value: "true"
   }
  ], 
  LoadBalancerArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188"
 };
 elbv2.modifyLoadBalancerAttributes(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Attributes: [
       {
      Key: "deletion_protection.enabled", 
      Value: "true"
     }, 
       {
      Key: "access_logs.s3.enabled", 
      Value: "false"
     }, 
       {
      Key: "idle_timeout.timeout_seconds", 
      Value: "60"
     }, 
       {
      Key: "access_logs.s3.prefix", 
      Value: ""
     }, 
       {
      Key: "access_logs.s3.bucket", 
      Value: ""
     }
    ]
   }
   */
 });

To change the idle timeout


/* This example changes the idle timeout value for the specified load balancer. */

 var params = {
  Attributes: [
     {
    Key: "idle_timeout.timeout_seconds", 
    Value: "30"
   }
  ], 
  LoadBalancerArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188"
 };
 elbv2.modifyLoadBalancerAttributes(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Attributes: [
       {
      Key: "idle_timeout.timeout_seconds", 
      Value: "30"
     }, 
       {
      Key: "access_logs.s3.enabled", 
      Value: "false"
     }, 
       {
      Key: "access_logs.s3.prefix", 
      Value: ""
     }, 
       {
      Key: "deletion_protection.enabled", 
      Value: "true"
     }, 
       {
      Key: "access_logs.s3.bucket", 
      Value: ""
     }
    ]
   }
   */
 });

To enable access logs


/* This example enables access logs for the specified load balancer. Note that the S3 bucket must exist in the same region as the load balancer and must have a policy attached that grants access to the Elastic Load Balancing service. */

 var params = {
  Attributes: [
     {
    Key: "access_logs.s3.enabled", 
    Value: "true"
   }, 
     {
    Key: "access_logs.s3.bucket", 
    Value: "my-loadbalancer-logs"
   }, 
     {
    Key: "access_logs.s3.prefix", 
    Value: "myapp"
   }
  ], 
  LoadBalancerArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188"
 };
 elbv2.modifyLoadBalancerAttributes(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Attributes: [
       {
      Key: "access_logs.s3.enabled", 
      Value: "true"
     }, 
       {
      Key: "access_logs.s3.bucket", 
      Value: "my-load-balancer-logs"
     }, 
       {
      Key: "access_logs.s3.prefix", 
      Value: "myapp"
     }, 
       {
      Key: "idle_timeout.timeout_seconds", 
      Value: "60"
     }, 
       {
      Key: "deletion_protection.enabled", 
      Value: "false"
     }
    ]
   }
   */
 });

Calling the modifyLoadBalancerAttributes operation

var params = {
  Attributes: [ /* required */
    {
      Key: 'STRING_VALUE',
      Value: 'STRING_VALUE'
    },
    /* more items */
  ],
  LoadBalancerArn: 'STRING_VALUE' /* required */
};
elbv2.modifyLoadBalancerAttributes(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • LoadBalancerArn — (String)

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

    • Attributes — (Array<map>)

      The load balancer attributes.

      • Key — (String)

        The name of the attribute.

        • access_logs.s3.enabled - Indicates whether access logs stored in Amazon S3 are enabled. The value is true or false.

        • access_logs.s3.bucket - The name of the S3 bucket for the access logs. This attribute is required if access logs in Amazon S3 are enabled. The bucket must exist in the same region as the load balancer and have a bucket policy that grants Elastic Load Balancing permission to write to the bucket.

        • access_logs.s3.prefix - The prefix for the location in the S3 bucket. If you don't specify a prefix, the access logs are stored in the root of the bucket.

        • deletion_protection.enabled - Indicates whether deletion protection is enabled. The value is true or false.

        • idle_timeout.timeout_seconds - The idle timeout value, in seconds. The valid range is 1-3600. The default is 60 seconds.

      • Value — (String)

        The value of the attribute.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Attributes — (Array<map>)

        Information about the load balancer attributes.

        • Key — (String)

          The name of the attribute.

          • access_logs.s3.enabled - Indicates whether access logs stored in Amazon S3 are enabled. The value is true or false.

          • access_logs.s3.bucket - The name of the S3 bucket for the access logs. This attribute is required if access logs in Amazon S3 are enabled. The bucket must exist in the same region as the load balancer and have a bucket policy that grants Elastic Load Balancing permission to write to the bucket.

          • access_logs.s3.prefix - The prefix for the location in the S3 bucket. If you don't specify a prefix, the access logs are stored in the root of the bucket.

          • deletion_protection.enabled - Indicates whether deletion protection is enabled. The value is true or false.

          • idle_timeout.timeout_seconds - The idle timeout value, in seconds. The valid range is 1-3600. The default is 60 seconds.

        • Value — (String)

          The value of the attribute.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

modifyRule(params = {}, callback) ⇒ AWS.Request

Modifies the specified rule.

Any existing properties that you do not modify retain their current values.

To modify the default action, use ModifyListener.

Service Reference:

Examples:

To modify a rule


/* This example modifies the condition for the specified rule. */

 var params = {
  Conditions: [
     {
    Field: "path-pattern", 
    Values: [
       "/images/*"
    ]
   }
  ], 
  RuleArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/9683b2d02a6cabee"
 };
 elbv2.modifyRule(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Rules: [
       {
      Actions: [
         {
        TargetGroupArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", 
        Type: "forward"
       }
      ], 
      Conditions: [
         {
        Field: "path-pattern", 
        Values: [
           "/images/*"
        ]
       }
      ], 
      IsDefault: false, 
      Priority: "10", 
      RuleArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/9683b2d02a6cabee"
     }
    ]
   }
   */
 });

Calling the modifyRule operation

var params = {
  RuleArn: 'STRING_VALUE', /* required */
  Actions: [
    {
      TargetGroupArn: 'STRING_VALUE', /* required */
      Type: forward /* required */
    },
    /* more items */
  ],
  Conditions: [
    {
      Field: 'STRING_VALUE',
      Values: [
        'STRING_VALUE',
        /* more items */
      ]
    },
    /* more items */
  ]
};
elbv2.modifyRule(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • RuleArn — (String)

      The Amazon Resource Name (ARN) of the rule.

    • Conditions — (Array<map>)

      The conditions.

      • Field — (String)

        The name of the field. The possible values are host-header and path-pattern.

      • Values — (Array<String>)

        The condition value.

        If the field name is host-header, you can specify a single host name (for example, my.example.com). A host name is case insensitive, can be up to 128 characters in length, and can contain any of the following characters. Note that you can include up to three wildcard characters.

        • A-Z, a-z, 0-9

        • - .

        • (matches 0 or more characters)

        • ? (matches exactly 1 character)

        If the field name is path-pattern, you can specify a single path pattern (for example, /img/). A path pattern is case sensitive, can be up to 128 characters in length, and can contain any of the following characters. Note that you can include up to three wildcard characters.

        • A-Z, a-z, 0-9

        • _ - . $ / ~ " ' @ : +

        • & (using &amp;)

        • * (matches 0 or more characters)

        • ? (matches exactly 1 character)

    • Actions — (Array<map>)

      The actions.

      • Typerequired — (String)

        The type of action.

        Possible values include:
        • "forward"
      • TargetGroupArnrequired — (String)

        The Amazon Resource Name (ARN) of the target group.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Rules — (Array<map>)

        Information about the rule.

        • RuleArn — (String)

          The Amazon Resource Name (ARN) of the rule.

        • Priority — (String)

          The priority.

        • Conditions — (Array<map>)

          The conditions.

          • Field — (String)

            The name of the field. The possible values are host-header and path-pattern.

          • Values — (Array<String>)

            The condition value.

            If the field name is host-header, you can specify a single host name (for example, my.example.com). A host name is case insensitive, can be up to 128 characters in length, and can contain any of the following characters. Note that you can include up to three wildcard characters.

            • A-Z, a-z, 0-9

            • - .

            • (matches 0 or more characters)

            • ? (matches exactly 1 character)

            If the field name is path-pattern, you can specify a single path pattern (for example, /img/). A path pattern is case sensitive, can be up to 128 characters in length, and can contain any of the following characters. Note that you can include up to three wildcard characters.

            • A-Z, a-z, 0-9

            • _ - . $ / ~ " ' @ : +

            • & (using &amp;)

            • * (matches 0 or more characters)

            • ? (matches exactly 1 character)

        • Actions — (Array<map>)

          The actions.

          • Typerequired — (String)

            The type of action.

            Possible values include:
            • "forward"
          • TargetGroupArnrequired — (String)

            The Amazon Resource Name (ARN) of the target group.

        • IsDefault — (Boolean)

          Indicates whether this is the default rule.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

modifyTargetGroup(params = {}, callback) ⇒ AWS.Request

Modifies the health checks used when evaluating the health state of the targets in the specified target group.

To monitor the health of the targets, use DescribeTargetHealth.

Service Reference:

Examples:

To modify the health check configuration for a target group


/* This example changes the configuration of the health checks used to evaluate the health of the targets for the specified target group. */

 var params = {
  HealthCheckPort: "443", 
  HealthCheckProtocol: "HTTPS", 
  TargetGroupArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-https-targets/2453ed029918f21f"
 };
 elbv2.modifyTargetGroup(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    TargetGroups: [
       {
      HealthCheckIntervalSeconds: 30, 
      HealthCheckPort: "443", 
      HealthCheckProtocol: "HTTPS", 
      HealthCheckTimeoutSeconds: 5, 
      HealthyThresholdCount: 5, 
      LoadBalancerArns: [
         "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188"
      ], 
      Matcher: {
       HttpCode: "200"
      }, 
      Port: 443, 
      Protocol: "HTTPS", 
      TargetGroupArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-https-targets/2453ed029918f21f", 
      TargetGroupName: "my-https-targets", 
      UnhealthyThresholdCount: 2, 
      VpcId: "vpc-3ac0fb5f"
     }
    ]
   }
   */
 });

Calling the modifyTargetGroup operation

var params = {
  TargetGroupArn: 'STRING_VALUE', /* required */
  HealthCheckIntervalSeconds: 0,
  HealthCheckPath: 'STRING_VALUE',
  HealthCheckPort: 'STRING_VALUE',
  HealthCheckProtocol: HTTP | HTTPS,
  HealthCheckTimeoutSeconds: 0,
  HealthyThresholdCount: 0,
  Matcher: {
    HttpCode: 'STRING_VALUE' /* required */
  },
  UnhealthyThresholdCount: 0
};
elbv2.modifyTargetGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • TargetGroupArn — (String)

      The Amazon Resource Name (ARN) of the target group.

    • HealthCheckProtocol — (String)

      The protocol to use to connect with the target.

      Possible values include:
      • "HTTP"
      • "HTTPS"
    • HealthCheckPort — (String)

      The port to use to connect with the target.

    • HealthCheckPath — (String)

      The ping path that is the destination for the health check request.

    • HealthCheckIntervalSeconds — (Integer)

      The approximate amount of time, in seconds, between health checks of an individual target.

    • HealthCheckTimeoutSeconds — (Integer)

      The amount of time, in seconds, during which no response means a failed health check.

    • HealthyThresholdCount — (Integer)

      The number of consecutive health checks successes required before considering an unhealthy target healthy.

    • UnhealthyThresholdCount — (Integer)

      The number of consecutive health check failures required before considering the target unhealthy.

    • Matcher — (map)

      The HTTP codes to use when checking for a successful response from a target.

      • HttpCoderequired — (String)

        The HTTP codes. You can specify values between 200 and 499. The default value is 200. You can specify multiple values (for example, "200,202") or a range of values (for example, "200-299").

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • TargetGroups — (Array<map>)

        Information about the target group.

        • TargetGroupArn — (String)

          The Amazon Resource Name (ARN) of the target group.

        • TargetGroupName — (String)

          The name of the target group.

        • Protocol — (String)

          The protocol to use for routing traffic to the targets.

          Possible values include:
          • "HTTP"
          • "HTTPS"
        • Port — (Integer)

          The port on which the targets are listening.

        • VpcId — (String)

          The ID of the VPC for the targets.

        • HealthCheckProtocol — (String)

          The protocol to use to connect with the target.

          Possible values include:
          • "HTTP"
          • "HTTPS"
        • HealthCheckPort — (String)

          The port to use to connect with the target.

        • HealthCheckIntervalSeconds — (Integer)

          The approximate amount of time, in seconds, between health checks of an individual target.

        • HealthCheckTimeoutSeconds — (Integer)

          The amount of time, in seconds, during which no response means a failed health check.

        • HealthyThresholdCount — (Integer)

          The number of consecutive health checks successes required before considering an unhealthy target healthy.

        • UnhealthyThresholdCount — (Integer)

          The number of consecutive health check failures required before considering the target unhealthy.

        • HealthCheckPath — (String)

          The destination for the health check request.

        • Matcher — (map)

          The HTTP codes to use when checking for a successful response from a target.

          • HttpCoderequired — (String)

            The HTTP codes. You can specify values between 200 and 499. The default value is 200. You can specify multiple values (for example, "200,202") or a range of values (for example, "200-299").

        • LoadBalancerArns — (Array<String>)

          The Amazon Resource Names (ARN) of the load balancers that route traffic to this target group.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

modifyTargetGroupAttributes(params = {}, callback) ⇒ AWS.Request

Modifies the specified attributes of the specified target group.

Service Reference:

Examples:

To modify the deregistration delay timeout


/* This example sets the deregistration delay timeout to the specified value for the specified target group. */

 var params = {
  Attributes: [
     {
    Key: "deregistration_delay.timeout_seconds", 
    Value: "600"
   }
  ], 
  TargetGroupArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067"
 };
 elbv2.modifyTargetGroupAttributes(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Attributes: [
       {
      Key: "stickiness.enabled", 
      Value: "false"
     }, 
       {
      Key: "deregistration_delay.timeout_seconds", 
      Value: "600"
     }, 
       {
      Key: "stickiness.type", 
      Value: "lb_cookie"
     }, 
       {
      Key: "stickiness.lb_cookie.duration_seconds", 
      Value: "86400"
     }
    ]
   }
   */
 });

Calling the modifyTargetGroupAttributes operation

var params = {
  Attributes: [ /* required */
    {
      Key: 'STRING_VALUE',
      Value: 'STRING_VALUE'
    },
    /* more items */
  ],
  TargetGroupArn: 'STRING_VALUE' /* required */
};
elbv2.modifyTargetGroupAttributes(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • TargetGroupArn — (String)

      The Amazon Resource Name (ARN) of the target group.

    • Attributes — (Array<map>)

      The attributes.

      • Key — (String)

        The name of the attribute.

        • deregistration_delay.timeout_seconds - The amount time for Elastic Load Balancing to wait before changing the state of a deregistering target from draining to unused. The range is 0-3600 seconds. The default value is 300 seconds.

        • stickiness.enabled - Indicates whether sticky sessions are enabled. The value is true or false.

        • stickiness.type - The type of sticky sessions. The possible value is lb_cookie.

        • stickiness.lb_cookie.duration_seconds - The time period, in seconds, during which requests from a client should be routed to the same target. After this time period expires, the load balancer-generated cookie is considered stale. The range is 1 second to 1 week (604800 seconds). The default value is 1 day (86400 seconds).

      • Value — (String)

        The value of the attribute.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Attributes — (Array<map>)

        Information about the attributes.

        • Key — (String)

          The name of the attribute.

          • deregistration_delay.timeout_seconds - The amount time for Elastic Load Balancing to wait before changing the state of a deregistering target from draining to unused. The range is 0-3600 seconds. The default value is 300 seconds.

          • stickiness.enabled - Indicates whether sticky sessions are enabled. The value is true or false.

          • stickiness.type - The type of sticky sessions. The possible value is lb_cookie.

          • stickiness.lb_cookie.duration_seconds - The time period, in seconds, during which requests from a client should be routed to the same target. After this time period expires, the load balancer-generated cookie is considered stale. The range is 1 second to 1 week (604800 seconds). The default value is 1 day (86400 seconds).

        • Value — (String)

          The value of the attribute.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

registerTargets(params = {}, callback) ⇒ AWS.Request

Registers the specified targets with the specified target group.

By default, the load balancer routes requests to registered targets using the protocol and port number for the target group. Alternatively, you can override the port for a target when you register it.

The target must be in the virtual private cloud (VPC) that you specified for the target group. If the target is an EC2 instance, it must be in the running state when you register it.

To remove a target from a target group, use DeregisterTargets.

Service Reference:

Examples:

To register targets with a target group


/* This example registers the specified instances with the specified target group. */

 var params = {
  TargetGroupArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", 
  Targets: [
     {
    Id: "i-80c8dd94"
   }, 
     {
    Id: "i-ceddcd4d"
   }
  ]
 };
 elbv2.registerTargets(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

To register targets with a target group using port overrides


/* This example registers the specified instance with the specified target group using multiple ports. This enables you to register ECS containers on the same instance as targets in the target group. */

 var params = {
  TargetGroupArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-new-targets/3bb63f11dfb0faf9", 
  Targets: [
     {
    Id: "i-80c8dd94", 
    Port: 80
   }, 
     {
    Id: "i-80c8dd94", 
    Port: 766
   }
  ]
 };
 elbv2.registerTargets(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

Calling the registerTargets operation

var params = {
  TargetGroupArn: 'STRING_VALUE', /* required */
  Targets: [ /* required */
    {
      Id: 'STRING_VALUE', /* required */
      Port: 0
    },
    /* more items */
  ]
};
elbv2.registerTargets(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • TargetGroupArn — (String)

      The Amazon Resource Name (ARN) of the target group.

    • Targets — (Array<map>)

      The targets. The default port for a target is the port for the target group. You can specify a port override. If a target is already registered, you can register it again using a different port.

      • Idrequired — (String)

        The ID of the target.

      • Port — (Integer)

        The port on which the target is listening.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

removeTags(params = {}, callback) ⇒ AWS.Request

Removes the specified tags from the specified resource.

To list the current tags for your resources, use DescribeTags.

Service Reference:

Examples:

To remove tags from a load balancer


/* This example removes the specified tags from the specified load balancer. */

 var params = {
  ResourceArns: [
     "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188"
  ], 
  TagKeys: [
     "project", 
     "department"
  ]
 };
 elbv2.removeTags(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

Calling the removeTags operation

var params = {
  ResourceArns: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  TagKeys: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
elbv2.removeTags(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ResourceArns — (Array<String>)

      The Amazon Resource Name (ARN) of the resource.

    • TagKeys — (Array<String>)

      The tag keys for the tags to remove.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

setIpAddressType(params = {}, callback) ⇒ AWS.Request

Sets the type of IP addresses used by the subnets of the specified Application Load Balancer.

Service Reference:

Examples:

Calling the setIpAddressType operation

var params = {
  IpAddressType: ipv4 | dualstack, /* required */
  LoadBalancerArn: 'STRING_VALUE' /* required */
};
elbv2.setIpAddressType(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • LoadBalancerArn — (String)

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

    • IpAddressType — (String)

      The IP address type. The possible values are ipv4 (for IPv4 addresses) and dualstack (for IPv4 and IPv6 addresses). Internal load balancers must use ipv4.

      Possible values include:
      • "ipv4"
      • "dualstack"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • IpAddressType — (String)

        The IP address type.

        Possible values include:
        • "ipv4"
        • "dualstack"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

setRulePriorities(params = {}, callback) ⇒ AWS.Request

Sets the priorities of the specified rules.

You can reorder the rules as long as there are no priority conflicts in the new order. Any existing rules that you do not specify retain their current priority.

Service Reference:

Examples:

To set the rule priority


/* This example sets the priority of the specified rule. */

 var params = {
  RulePriorities: [
     {
    Priority: 5, 
    RuleArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/1291d13826f405c3"
   }
  ]
 };
 elbv2.setRulePriorities(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    Rules: [
       {
      Actions: [
         {
        TargetGroupArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", 
        Type: "forward"
       }
      ], 
      Conditions: [
         {
        Field: "path-pattern", 
        Values: [
           "/img/*"
        ]
       }
      ], 
      IsDefault: false, 
      Priority: "5", 
      RuleArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/1291d13826f405c3"
     }
    ]
   }
   */
 });

Calling the setRulePriorities operation

var params = {
  RulePriorities: [ /* required */
    {
      Priority: 0,
      RuleArn: 'STRING_VALUE'
    },
    /* more items */
  ]
};
elbv2.setRulePriorities(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • RulePriorities — (Array<map>)

      The rule priorities.

      • RuleArn — (String)

        The Amazon Resource Name (ARN) of the rule.

      • Priority — (Integer)

        The rule priority.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Rules — (Array<map>)

        Information about the rules.

        • RuleArn — (String)

          The Amazon Resource Name (ARN) of the rule.

        • Priority — (String)

          The priority.

        • Conditions — (Array<map>)

          The conditions.

          • Field — (String)

            The name of the field. The possible values are host-header and path-pattern.

          • Values — (Array<String>)

            The condition value.

            If the field name is host-header, you can specify a single host name (for example, my.example.com). A host name is case insensitive, can be up to 128 characters in length, and can contain any of the following characters. Note that you can include up to three wildcard characters.

            • A-Z, a-z, 0-9

            • - .

            • (matches 0 or more characters)

            • ? (matches exactly 1 character)

            If the field name is path-pattern, you can specify a single path pattern (for example, /img/). A path pattern is case sensitive, can be up to 128 characters in length, and can contain any of the following characters. Note that you can include up to three wildcard characters.

            • A-Z, a-z, 0-9

            • _ - . $ / ~ " ' @ : +

            • & (using &amp;)

            • * (matches 0 or more characters)

            • ? (matches exactly 1 character)

        • Actions — (Array<map>)

          The actions.

          • Typerequired — (String)

            The type of action.

            Possible values include:
            • "forward"
          • TargetGroupArnrequired — (String)

            The Amazon Resource Name (ARN) of the target group.

        • IsDefault — (Boolean)

          Indicates whether this is the default rule.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

setSecurityGroups(params = {}, callback) ⇒ AWS.Request

Associates the specified security groups with the specified load balancer. The specified security groups override the previously associated security groups.

Service Reference:

Examples:

To associate a security group with a load balancer


/* This example associates the specified security group with the specified load balancer. */

 var params = {
  LoadBalancerArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188", 
  SecurityGroups: [
     "sg-5943793c"
  ]
 };
 elbv2.setSecurityGroups(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    SecurityGroupIds: [
       "sg-5943793c"
    ]
   }
   */
 });

Calling the setSecurityGroups operation

var params = {
  LoadBalancerArn: 'STRING_VALUE', /* required */
  SecurityGroups: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
elbv2.setSecurityGroups(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • LoadBalancerArn — (String)

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

    • SecurityGroups — (Array<String>)

      The IDs of the security groups.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • SecurityGroupIds — (Array<String>)

        The IDs of the security groups associated with the load balancer.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

setSubnets(params = {}, callback) ⇒ AWS.Request

Enables the Availability Zone for the specified subnets for the specified load balancer. The specified subnets replace the previously enabled subnets.

Service Reference:

Examples:

To enable Availability Zones for a load balancer


/* This example enables the Availability Zones for the specified subnets for the specified load balancer. */

 var params = {
  LoadBalancerArn: "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188", 
  Subnets: [
     "subnet-8360a9e7", 
     "subnet-b7d581c0"
  ]
 };
 elbv2.setSubnets(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    AvailabilityZones: [
       {
      SubnetId: "subnet-8360a9e7", 
      ZoneName: "us-west-2a"
     }, 
       {
      SubnetId: "subnet-b7d581c0", 
      ZoneName: "us-west-2b"
     }
    ]
   }
   */
 });

Calling the setSubnets operation

var params = {
  LoadBalancerArn: 'STRING_VALUE', /* required */
  Subnets: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
elbv2.setSubnets(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • LoadBalancerArn — (String)

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

    • Subnets — (Array<String>)

      The IDs of the subnets. You must specify at least two subnets. You can add only one subnet per Availability Zone.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • AvailabilityZones — (Array<map>)

        Information about the subnet and Availability Zone.

        • ZoneName — (String)

          The name of the Availability Zone.

        • SubnetId — (String)

          The ID of the subnet.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

waitFor(state, params = {}, callback) ⇒ AWS.Request

Waits for a given ELBv2 resource. The final callback or 'complete' event will be fired only when the resource is either in its final state or the waiter has timed out and stopped polling for the final state.

Examples:

Waiting for the loadBalancerExists state

var params = {
  // ... input parameters ...
};
elbv2.waitFor('loadBalancerExists', params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • state (String)

    the resource state to wait for. Available states for this service are listed in "Waiter Resource States" below.

  • params (map) (defaults to: {})

    a list of parameters for the given state. See each waiter resource state for required parameters.

Callback (callback):

  • function(err, data) { ... }

    Callback containing error and data information. See the respective resource state for the expected error or data information.

    If the waiter times out its requests, it will return a ResourceNotReady error.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

Waiter Resource States:

Waiter Resource Details

elbv2.waitFor('loadBalancerExists', params = {}, [callback]) ⇒ AWS.Request

Waits for the loadBalancerExists state by periodically calling the underlying ELBv2.describeLoadBalancers() operation every 15 seconds (at most 40 times).

Examples:

Waiting for the loadBalancerExists state

var params = {
  // ... input parameters ...
};
elbv2.waitFor('loadBalancerExists', params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object)
    • LoadBalancerArns — (Array<String>)

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

    • Names — (Array<String>)

      The names of the load balancers.

    • Marker — (String)

      The marker for the next set of results. (You received this marker from a previous call.)

    • PageSize — (Integer)

      The maximum number of results to return with this call.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • LoadBalancers — (Array<map>)

        Information about the load balancers.

        • 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 — (Date)

          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 only route requests from clients with access to the VPC for the load balancer.

          Possible values include:
          • "internet-facing"
          • "internal"
        • VpcId — (String)

          The ID of the VPC for the load balancer.

        • State — (map)

          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 the load balancer could not be set up, its state is failed.

            Possible values include:
            • "active"
            • "provisioning"
            • "failed"
          • Reason — (String)

            A description of the state.

        • Type — (String)

          The type of load balancer.

          Possible values include:
          • "application"
        • AvailabilityZones — (Array<map>)

          The Availability Zones for the load balancer.

          • ZoneName — (String)

            The name of the Availability Zone.

          • SubnetId — (String)

            The ID of the subnet.

        • SecurityGroups — (Array<String>)

          The IDs of the security groups for the load balancer.

        • IpAddressType — (String)

          The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 (for IPv4 addresses) and dualstack (for IPv4 and IPv6 addresses).

          Possible values include:
          • "ipv4"
          • "dualstack"
      • NextMarker — (String)

        The marker to use when requesting the next set of results. If there are no additional results, the string is empty.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

See Also:

elbv2.waitFor('loadBalancerAvailable', params = {}, [callback]) ⇒ AWS.Request

Waits for the loadBalancerAvailable state by periodically calling the underlying ELBv2.describeLoadBalancers() operation every 15 seconds (at most 40 times).

Examples:

Waiting for the loadBalancerAvailable state

var params = {
  // ... input parameters ...
};
elbv2.waitFor('loadBalancerAvailable', params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object)
    • LoadBalancerArns — (Array<String>)

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

    • Names — (Array<String>)

      The names of the load balancers.

    • Marker — (String)

      The marker for the next set of results. (You received this marker from a previous call.)

    • PageSize — (Integer)

      The maximum number of results to return with this call.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • LoadBalancers — (Array<map>)

        Information about the load balancers.

        • 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 — (Date)

          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 only route requests from clients with access to the VPC for the load balancer.

          Possible values include:
          • "internet-facing"
          • "internal"
        • VpcId — (String)

          The ID of the VPC for the load balancer.

        • State — (map)

          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 the load balancer could not be set up, its state is failed.

            Possible values include:
            • "active"
            • "provisioning"
            • "failed"
          • Reason — (String)

            A description of the state.

        • Type — (String)

          The type of load balancer.

          Possible values include:
          • "application"
        • AvailabilityZones — (Array<map>)

          The Availability Zones for the load balancer.

          • ZoneName — (String)

            The name of the Availability Zone.

          • SubnetId — (String)

            The ID of the subnet.

        • SecurityGroups — (Array<String>)

          The IDs of the security groups for the load balancer.

        • IpAddressType — (String)

          The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 (for IPv4 addresses) and dualstack (for IPv4 and IPv6 addresses).

          Possible values include:
          • "ipv4"
          • "dualstack"
      • NextMarker — (String)

        The marker to use when requesting the next set of results. If there are no additional results, the string is empty.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

See Also:

elbv2.waitFor('loadBalancersDeleted', params = {}, [callback]) ⇒ AWS.Request

Waits for the loadBalancersDeleted state by periodically calling the underlying ELBv2.describeLoadBalancers() operation every 15 seconds (at most 40 times).

Examples:

Waiting for the loadBalancersDeleted state

var params = {
  // ... input parameters ...
};
elbv2.waitFor('loadBalancersDeleted', params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object)
    • LoadBalancerArns — (Array<String>)

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

    • Names — (Array<String>)

      The names of the load balancers.

    • Marker — (String)

      The marker for the next set of results. (You received this marker from a previous call.)

    • PageSize — (Integer)

      The maximum number of results to return with this call.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • LoadBalancers — (Array<map>)

        Information about the load balancers.

        • 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 — (Date)

          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 only route requests from clients with access to the VPC for the load balancer.

          Possible values include:
          • "internet-facing"
          • "internal"
        • VpcId — (String)

          The ID of the VPC for the load balancer.

        • State — (map)

          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 the load balancer could not be set up, its state is failed.

            Possible values include:
            • "active"
            • "provisioning"
            • "failed"
          • Reason — (String)

            A description of the state.

        • Type — (String)

          The type of load balancer.

          Possible values include:
          • "application"
        • AvailabilityZones — (Array<map>)

          The Availability Zones for the load balancer.

          • ZoneName — (String)

            The name of the Availability Zone.

          • SubnetId — (String)

            The ID of the subnet.

        • SecurityGroups — (Array<String>)

          The IDs of the security groups for the load balancer.

        • IpAddressType — (String)

          The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 (for IPv4 addresses) and dualstack (for IPv4 and IPv6 addresses).

          Possible values include:
          • "ipv4"
          • "dualstack"
      • NextMarker — (String)

        The marker to use when requesting the next set of results. If there are no additional results, the string is empty.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

See Also: