AWS.ELBv2 — AWS SDK for JavaScript (original) (raw)

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

Property Details

endpointAWS.Endpoint

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

Method Details

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

Adds the specified SSL server certificate to the certificate list for the specified HTTPS or TLS listener.

If the certificate in already in the certificate list, the call is successful but the certificate is not added again.

For more information, see HTTPS listeners in the Application Load Balancers Guide or TLS listeners in the Network Load Balancers Guide.

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

Adds the specified tags to the specified Elastic Load Balancing resource. You can tag your Application Load Balancers, Network Load Balancers, Gateway Load Balancers, target groups, trust stores, listeners, and rules.

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.

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

Adds the specified revocation file to the specified trust store.

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

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

Creates an Application Load Balancer, Network Load Balancer, or Gateway Load Balancer.

For more information, see the following:

This operation is idempotent, which means that it completes at most one time. If you attempt to create multiple load balancers with the same settings, each call succeeds.

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 */
  CustomerOwnedIpv4Pool: 'STRING_VALUE',
  IpAddressType: ipv4 | dualstack | dualstack-without-public-ipv4,
  Scheme: internet-facing | internal,
  SecurityGroups: [
    'STRING_VALUE',
    /* more items */
  ],
  SubnetMappings: [
    {
      AllocationId: 'STRING_VALUE',
      IPv6Address: 'STRING_VALUE',
      PrivateIPv4Address: 'STRING_VALUE',
      SubnetId: 'STRING_VALUE'
    },
    /* more items */
  ],
  Subnets: [
    'STRING_VALUE',
    /* more items */
  ],
  Tags: [
    {
      Key: 'STRING_VALUE', /* required */
      Value: 'STRING_VALUE'
    },
    /* more items */
  ],
  Type: application | network | gateway
};
elbv2.createLoadBalancer(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Creates a rule for the specified listener. The listener must be associated with an Application Load Balancer.

Each rule consists of a priority, one or more actions, and one or more conditions. Rules are evaluated in priority order, from the lowest value to the highest value. When the conditions for a rule are met, its actions are performed. If the conditions for no rules are met, the actions for the default rule are performed. For more information, see Listener rules in the Application Load Balancers Guide.

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 */
    {
      Type: forward | authenticate-oidc | authenticate-cognito | redirect | fixed-response, /* required */
      AuthenticateCognitoConfig: {
        UserPoolArn: 'STRING_VALUE', /* required */
        UserPoolClientId: 'STRING_VALUE', /* required */
        UserPoolDomain: 'STRING_VALUE', /* required */
        AuthenticationRequestExtraParams: {
          '<AuthenticateCognitoActionAuthenticationRequestParamName>': 'STRING_VALUE',
          /* '<AuthenticateCognitoActionAuthenticationRequestParamName>': ... */
        },
        OnUnauthenticatedRequest: deny | allow | authenticate,
        Scope: 'STRING_VALUE',
        SessionCookieName: 'STRING_VALUE',
        SessionTimeout: 'NUMBER_VALUE'
      },
      AuthenticateOidcConfig: {
        AuthorizationEndpoint: 'STRING_VALUE', /* required */
        ClientId: 'STRING_VALUE', /* required */
        Issuer: 'STRING_VALUE', /* required */
        TokenEndpoint: 'STRING_VALUE', /* required */
        UserInfoEndpoint: 'STRING_VALUE', /* required */
        AuthenticationRequestExtraParams: {
          '<AuthenticateOidcActionAuthenticationRequestParamName>': 'STRING_VALUE',
          /* '<AuthenticateOidcActionAuthenticationRequestParamName>': ... */
        },
        ClientSecret: 'STRING_VALUE',
        OnUnauthenticatedRequest: deny | allow | authenticate,
        Scope: 'STRING_VALUE',
        SessionCookieName: 'STRING_VALUE',
        SessionTimeout: 'NUMBER_VALUE',
        UseExistingClientSecret: true || false
      },
      FixedResponseConfig: {
        StatusCode: 'STRING_VALUE', /* required */
        ContentType: 'STRING_VALUE',
        MessageBody: 'STRING_VALUE'
      },
      ForwardConfig: {
        TargetGroupStickinessConfig: {
          DurationSeconds: 'NUMBER_VALUE',
          Enabled: true || false
        },
        TargetGroups: [
          {
            TargetGroupArn: 'STRING_VALUE',
            Weight: 'NUMBER_VALUE'
          },
          /* more items */
        ]
      },
      Order: 'NUMBER_VALUE',
      RedirectConfig: {
        StatusCode: HTTP_301 | HTTP_302, /* required */
        Host: 'STRING_VALUE',
        Path: 'STRING_VALUE',
        Port: 'STRING_VALUE',
        Protocol: 'STRING_VALUE',
        Query: 'STRING_VALUE'
      },
      TargetGroupArn: 'STRING_VALUE'
    },
    /* more items */
  ],
  Conditions: [ /* required */
    {
      Field: 'STRING_VALUE',
      HostHeaderConfig: {
        Values: [
          'STRING_VALUE',
          /* more items */
        ]
      },
      HttpHeaderConfig: {
        HttpHeaderName: 'STRING_VALUE',
        Values: [
          'STRING_VALUE',
          /* more items */
        ]
      },
      HttpRequestMethodConfig: {
        Values: [
          'STRING_VALUE',
          /* more items */
        ]
      },
      PathPatternConfig: {
        Values: [
          'STRING_VALUE',
          /* more items */
        ]
      },
      QueryStringConfig: {
        Values: [
          {
            Key: 'STRING_VALUE',
            Value: 'STRING_VALUE'
          },
          /* more items */
        ]
      },
      SourceIpConfig: {
        Values: [
          'STRING_VALUE',
          /* more items */
        ]
      },
      Values: [
        'STRING_VALUE',
        /* more items */
      ]
    },
    /* more items */
  ],
  ListenerArn: 'STRING_VALUE', /* required */
  Priority: 'NUMBER_VALUE', /* required */
  Tags: [
    {
      Key: 'STRING_VALUE', /* required */
      Value: 'STRING_VALUE'
    },
    /* more items */
  ]
};
elbv2.createRule(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

`` * `Tags` — (`Array<map>`) The tags to assign to the rule. * `Key` — **required** — (`String`) The key of the tag. * `Value` — (`String`) The value of the tag. ``
`` ``

```````` ``````` Callback (callback):

``
`` `` `` ` Returns:

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

Creates a target group.

For more information, see the following:

This operation is idempotent, which means that it completes at most one time. If you attempt to create multiple target groups with the same settings, each call succeeds.

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 */
  HealthCheckEnabled: true || false,
  HealthCheckIntervalSeconds: 'NUMBER_VALUE',
  HealthCheckPath: 'STRING_VALUE',
  HealthCheckPort: 'STRING_VALUE',
  HealthCheckProtocol: HTTP | HTTPS | TCP | TLS | UDP | TCP_UDP | GENEVE,
  HealthCheckTimeoutSeconds: 'NUMBER_VALUE',
  HealthyThresholdCount: 'NUMBER_VALUE',
  IpAddressType: ipv4 | ipv6,
  Matcher: {
    GrpcCode: 'STRING_VALUE',
    HttpCode: 'STRING_VALUE'
  },
  Port: 'NUMBER_VALUE',
  Protocol: HTTP | HTTPS | TCP | TLS | UDP | TCP_UDP | GENEVE,
  ProtocolVersion: 'STRING_VALUE',
  Tags: [
    {
      Key: 'STRING_VALUE', /* required */
      Value: 'STRING_VALUE'
    },
    /* more items */
  ],
  TargetType: instance | ip | lambda | alb,
  UnhealthyThresholdCount: 'NUMBER_VALUE',
  VpcId: 'STRING_VALUE'
};
elbv2.createTargetGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Creates a trust store.

Service Reference:

Examples:

Calling the createTrustStore operation

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

Parameters:

Callback (callback):

Returns:

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

Deletes the specified listener.

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

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:

Callback (callback):

Returns:

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

Deletes the specified Application Load Balancer, Network Load Balancer, or Gateway Load Balancer. Deleting a load balancer also deletes its 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:

Callback (callback):

Returns:

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

Deletes the specified rule.

You can't delete the default 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:

Callback (callback):

Returns:

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

Deletes a shared trust store association.

Service Reference:

Examples:

Delete a shared trust store association


/* This example deletes the association between the specified trust store and the specified load balancer. */

 var params = {
  ResourceArn: "arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/app/my-load-balancer/80233fa81d678c2c", 
  TrustStoreArn: "arn:aws:elasticloadbalancing:us-east-1:123456789012:truststore/my-trust-store/73e2d6bc24d8a063"
 };
 elbv2.deleteSharedTrustStoreAssociation(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

Calling the deleteSharedTrustStoreAssociation operation

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

Parameters:

Callback (callback):

Returns:

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. Deleting a target group does not affect its registered targets. For example, any EC2 instances continue to run until you stop or terminate them.

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:

Callback (callback):

Returns:

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

Deletes a trust store.

Service Reference:

Examples:

Calling the deleteTrustStore operation

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

Parameters:

Callback (callback):

Returns:

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.

The load balancer stops sending requests to targets that are deregistering, but uses connection draining to ensure that in-flight traffic completes on the existing connections. This deregistration delay is configured by default but can be updated for each target group.

For more information, see the following:

Note: If the specified target does not exist, the action returns successfully.

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 */
      AvailabilityZone: 'STRING_VALUE',
      Port: 'NUMBER_VALUE'
    },
    /* 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:

Callback (callback):

Returns:

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

Describes the current Elastic Load Balancing resource limits for your Amazon Web Services account.

For more information, see the following:

Service Reference:

Examples:

Calling the describeAccountLimits operation

var params = {
  Marker: 'STRING_VALUE',
  PageSize: 'NUMBER_VALUE'
};
elbv2.describeAccountLimits(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Describes the attributes for the specified listener.

Service Reference:

Examples:

Describe listener attributes


/* This example describes the attributes of the specified listener. */

 var params = {
  ListenerArn: "aws:elasticloadbalancing:us-east-1:123456789012:listener/net/my-listener/73e2d6bc24d8a067/d5dc06411fa5bcea"
 };
 elbv2.describeListenerAttributes(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

Calling the describeListenerAttributes operation

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

Parameters:

Callback (callback):

Returns:

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

Describes the default certificate and the certificate list for the specified HTTPS or TLS listener.

If the default certificate is also in the certificate list, it appears twice in the results (once with IsDefault set to true and once with IsDefault set to false).

For more information, see SSL certificates in the Application Load Balancers Guide or Server certificates in the Network Load Balancers Guide.

Service Reference:

Examples:

Calling the describeListenerCertificates operation

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

Parameters:

Callback (callback):

Returns:

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

Describes the specified listeners or the listeners for the specified Application Load Balancer, Network Load Balancer, or Gateway 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: 'NUMBER_VALUE'
};
elbv2.describeListeners(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

`` ``

`` `Returns:

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

Describes the attributes for the specified Application Load Balancer, Network Load Balancer, or Gateway Load Balancer.

For more information, see the following:

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:

Callback (callback):

Returns:

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

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

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: 'NUMBER_VALUE'
};
elbv2.describeLoadBalancers(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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',
  Marker: 'STRING_VALUE',
  PageSize: 'NUMBER_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:

Callback (callback):

`` ``

`` `Returns:

```````````` ``````````` ### 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 or Security policies in the Network 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 = {
  LoadBalancerType: application | network | gateway,
  Marker: 'STRING_VALUE',
  Names: [
    'STRING_VALUE',
    /* more items */
  ],
  PageSize: 'NUMBER_VALUE'
};
elbv2.describeSSLPolicies(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Describes the tags for the specified Elastic Load Balancing resources. You can describe the tags for one or more Application Load Balancers, Network Load Balancers, Gateway Load Balancers, target groups, listeners, or rules.

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:

Callback (callback):

Returns:

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

Describes the attributes for the specified target group.

For more information, see the following:

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:

Callback (callback):

Returns:

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.

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: 'NUMBER_VALUE',
  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:

Callback (callback):

Returns:

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 */
  Include: [
    AnomalyDetection | All,
    /* more items */
  ],
  Targets: [
    {
      Id: 'STRING_VALUE', /* required */
      AvailabilityZone: 'STRING_VALUE',
      Port: 'NUMBER_VALUE'
    },
    /* 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:

Callback (callback):

Returns:

Waiter Resource States:

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

Describes all resources associated with the specified trust store.

Service Reference:

Examples:

Calling the describeTrustStoreAssociations operation

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

Parameters:

Callback (callback):

Returns:

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

Describes the revocation files in use by the specified trust store or revocation files.

Service Reference:

Examples:

Calling the describeTrustStoreRevocations operation

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

Parameters:

Callback (callback):

Returns:

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

Describes all trust stores for the specified account.

Service Reference:

Examples:

Calling the describeTrustStores operation

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

Parameters:

Callback (callback):

Returns:

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

Retrieves the resource policy for a specified resource.

Service Reference:

Examples:

Retrieve a resource policy


/* This example retrieves the resource policy for the specified trust store. */

 var params = {
  ResourceArn: "arn:aws:elasticloadbalancing:us-east-1:123456789012:truststore/my-trust-store/73e2d6bc24d8a067"
 };
 elbv2.getResourcePolicy(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
   }
   */
 });

Calling the getResourcePolicy operation

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

Parameters:

Callback (callback):

Returns:

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

Retrieves the ca certificate bundle.

This action returns a pre-signed S3 URI which is active for ten minutes.

Service Reference:

Examples:

Calling the getTrustStoreCaCertificatesBundle operation

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

Parameters:

Callback (callback):

Returns:

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

Retrieves the specified revocation file.

This action returns a pre-signed S3 URI which is active for ten minutes.

Service Reference:

Examples:

Calling the getTrustStoreRevocationContent operation

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

Parameters:

Callback (callback):

Returns:

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

Replaces the specified properties of the specified listener. Any properties that you do not specify remain unchanged.

Changing the protocol from HTTPS to HTTP, or from TLS to TCP, removes the security policy and default certificate properties. If you change the protocol from HTTP to HTTPS, or from TCP to TLS, you must add the security policy and default certificate properties.

To add an item to a list, remove an item from a list, or update an item in a list, you must provide the entire list. For example, to add an action, specify a list with the current actions plus the new action.

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 */
  AlpnPolicy: [
    'STRING_VALUE',
    /* more items */
  ],
  Certificates: [
    {
      CertificateArn: 'STRING_VALUE',
      IsDefault: true || false
    },
    /* more items */
  ],
  DefaultActions: [
    {
      Type: forward | authenticate-oidc | authenticate-cognito | redirect | fixed-response, /* required */
      AuthenticateCognitoConfig: {
        UserPoolArn: 'STRING_VALUE', /* required */
        UserPoolClientId: 'STRING_VALUE', /* required */
        UserPoolDomain: 'STRING_VALUE', /* required */
        AuthenticationRequestExtraParams: {
          '<AuthenticateCognitoActionAuthenticationRequestParamName>': 'STRING_VALUE',
          /* '<AuthenticateCognitoActionAuthenticationRequestParamName>': ... */
        },
        OnUnauthenticatedRequest: deny | allow | authenticate,
        Scope: 'STRING_VALUE',
        SessionCookieName: 'STRING_VALUE',
        SessionTimeout: 'NUMBER_VALUE'
      },
      AuthenticateOidcConfig: {
        AuthorizationEndpoint: 'STRING_VALUE', /* required */
        ClientId: 'STRING_VALUE', /* required */
        Issuer: 'STRING_VALUE', /* required */
        TokenEndpoint: 'STRING_VALUE', /* required */
        UserInfoEndpoint: 'STRING_VALUE', /* required */
        AuthenticationRequestExtraParams: {
          '<AuthenticateOidcActionAuthenticationRequestParamName>': 'STRING_VALUE',
          /* '<AuthenticateOidcActionAuthenticationRequestParamName>': ... */
        },
        ClientSecret: 'STRING_VALUE',
        OnUnauthenticatedRequest: deny | allow | authenticate,
        Scope: 'STRING_VALUE',
        SessionCookieName: 'STRING_VALUE',
        SessionTimeout: 'NUMBER_VALUE',
        UseExistingClientSecret: true || false
      },
      FixedResponseConfig: {
        StatusCode: 'STRING_VALUE', /* required */
        ContentType: 'STRING_VALUE',
        MessageBody: 'STRING_VALUE'
      },
      ForwardConfig: {
        TargetGroupStickinessConfig: {
          DurationSeconds: 'NUMBER_VALUE',
          Enabled: true || false
        },
        TargetGroups: [
          {
            TargetGroupArn: 'STRING_VALUE',
            Weight: 'NUMBER_VALUE'
          },
          /* more items */
        ]
      },
      Order: 'NUMBER_VALUE',
      RedirectConfig: {
        StatusCode: HTTP_301 | HTTP_302, /* required */
        Host: 'STRING_VALUE',
        Path: 'STRING_VALUE',
        Port: 'STRING_VALUE',
        Protocol: 'STRING_VALUE',
        Query: 'STRING_VALUE'
      },
      TargetGroupArn: 'STRING_VALUE'
    },
    /* more items */
  ],
  MutualAuthentication: {
    IgnoreClientCertificateExpiry: true || false,
    Mode: 'STRING_VALUE',
    TrustStoreArn: 'STRING_VALUE',
    TrustStoreAssociationStatus: active | removed
  },
  Port: 'NUMBER_VALUE',
  Protocol: HTTP | HTTPS | TCP | TLS | UDP | TCP_UDP | GENEVE,
  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:

``` `` * AlpnPolicy — (Array<String>)
[TLS listeners] The name of the Application-Layer Protocol Negotiation (ALPN) policy. You can specify one policy name. The following are the possible values:
* HTTP1Only
* HTTP2Only
* HTTP2Optional
* HTTP2Preferred
* None
For more information, see ALPN policies in the Network Load Balancers Guide.

``` ``` `` ```

```````` ``````` Callback (callback):

``
`` `` `` ` Returns:

`````````` ````````` ### modifyListenerAttributes(params = {}, callback) ⇒ AWS.Request

Modifies the specified attributes of the specified listener.

Service Reference:

Examples:

Calling the modifyListenerAttributes operation

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

Parameters:

Callback (callback):

Returns:

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

Modifies the specified attributes of the specified Application Load Balancer, Network Load Balancer, or Gateway 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:

Callback (callback):

Returns:

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

Replaces the specified properties of the specified rule. Any properties that you do not specify are unchanged.

To add an item to a list, remove an item from a list, or update an item in a list, you must provide the entire list. For example, to add an action, specify a list with the current actions plus the new action.

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: [
    {
      Type: forward | authenticate-oidc | authenticate-cognito | redirect | fixed-response, /* required */
      AuthenticateCognitoConfig: {
        UserPoolArn: 'STRING_VALUE', /* required */
        UserPoolClientId: 'STRING_VALUE', /* required */
        UserPoolDomain: 'STRING_VALUE', /* required */
        AuthenticationRequestExtraParams: {
          '<AuthenticateCognitoActionAuthenticationRequestParamName>': 'STRING_VALUE',
          /* '<AuthenticateCognitoActionAuthenticationRequestParamName>': ... */
        },
        OnUnauthenticatedRequest: deny | allow | authenticate,
        Scope: 'STRING_VALUE',
        SessionCookieName: 'STRING_VALUE',
        SessionTimeout: 'NUMBER_VALUE'
      },
      AuthenticateOidcConfig: {
        AuthorizationEndpoint: 'STRING_VALUE', /* required */
        ClientId: 'STRING_VALUE', /* required */
        Issuer: 'STRING_VALUE', /* required */
        TokenEndpoint: 'STRING_VALUE', /* required */
        UserInfoEndpoint: 'STRING_VALUE', /* required */
        AuthenticationRequestExtraParams: {
          '<AuthenticateOidcActionAuthenticationRequestParamName>': 'STRING_VALUE',
          /* '<AuthenticateOidcActionAuthenticationRequestParamName>': ... */
        },
        ClientSecret: 'STRING_VALUE',
        OnUnauthenticatedRequest: deny | allow | authenticate,
        Scope: 'STRING_VALUE',
        SessionCookieName: 'STRING_VALUE',
        SessionTimeout: 'NUMBER_VALUE',
        UseExistingClientSecret: true || false
      },
      FixedResponseConfig: {
        StatusCode: 'STRING_VALUE', /* required */
        ContentType: 'STRING_VALUE',
        MessageBody: 'STRING_VALUE'
      },
      ForwardConfig: {
        TargetGroupStickinessConfig: {
          DurationSeconds: 'NUMBER_VALUE',
          Enabled: true || false
        },
        TargetGroups: [
          {
            TargetGroupArn: 'STRING_VALUE',
            Weight: 'NUMBER_VALUE'
          },
          /* more items */
        ]
      },
      Order: 'NUMBER_VALUE',
      RedirectConfig: {
        StatusCode: HTTP_301 | HTTP_302, /* required */
        Host: 'STRING_VALUE',
        Path: 'STRING_VALUE',
        Port: 'STRING_VALUE',
        Protocol: 'STRING_VALUE',
        Query: 'STRING_VALUE'
      },
      TargetGroupArn: 'STRING_VALUE'
    },
    /* more items */
  ],
  Conditions: [
    {
      Field: 'STRING_VALUE',
      HostHeaderConfig: {
        Values: [
          'STRING_VALUE',
          /* more items */
        ]
      },
      HttpHeaderConfig: {
        HttpHeaderName: 'STRING_VALUE',
        Values: [
          'STRING_VALUE',
          /* more items */
        ]
      },
      HttpRequestMethodConfig: {
        Values: [
          'STRING_VALUE',
          /* more items */
        ]
      },
      PathPatternConfig: {
        Values: [
          'STRING_VALUE',
          /* more items */
        ]
      },
      QueryStringConfig: {
        Values: [
          {
            Key: 'STRING_VALUE',
            Value: 'STRING_VALUE'
          },
          /* more items */
        ]
      },
      SourceIpConfig: {
        Values: [
          'STRING_VALUE',
          /* more items */
        ]
      },
      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:

``
`` ``

```````` ``````` Callback (callback):

``
`` `` `` ` Returns:

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

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

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 */
  HealthCheckEnabled: true || false,
  HealthCheckIntervalSeconds: 'NUMBER_VALUE',
  HealthCheckPath: 'STRING_VALUE',
  HealthCheckPort: 'STRING_VALUE',
  HealthCheckProtocol: HTTP | HTTPS | TCP | TLS | UDP | TCP_UDP | GENEVE,
  HealthCheckTimeoutSeconds: 'NUMBER_VALUE',
  HealthyThresholdCount: 'NUMBER_VALUE',
  Matcher: {
    GrpcCode: 'STRING_VALUE',
    HttpCode: 'STRING_VALUE'
  },
  UnhealthyThresholdCount: 'NUMBER_VALUE'
};
elbv2.modifyTargetGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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:

Callback (callback):

Returns:

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

Update the ca certificate bundle for the specified trust store.

Service Reference:

Examples:

Calling the modifyTrustStore operation

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

Parameters:

Callback (callback):

Returns:

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

Registers the specified targets with the specified target group.

If the target is an EC2 instance, it must be in the running state when you register it.

By default, the load balancer routes requests to registered targets using the protocol and port for the target group. Alternatively, you can override the port for a target when you register it. You can register each EC2 instance or IP address with the same target group multiple times using different ports.

With a Network Load Balancer, you cannot register instances by instance ID if they have the following instance types: C1, CC1, CC2, CG1, CG2, CR1, CS1, G1, G2, HI1, HS1, M1, M2, M3, and T1. You can register instances of these types by IP address.

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 */
      AvailabilityZone: 'STRING_VALUE',
      Port: 'NUMBER_VALUE'
    },
    /* 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:

Callback (callback):

Returns:

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

Removes the specified certificate from the certificate list for the specified HTTPS or TLS listener.

Service Reference:

Examples:

Calling the removeListenerCertificates operation

var params = {
  Certificates: [ /* required */
    {
      CertificateArn: 'STRING_VALUE',
      IsDefault: true || false
    },
    /* more items */
  ],
  ListenerArn: 'STRING_VALUE' /* required */
};
elbv2.removeListenerCertificates(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Removes the specified tags from the specified Elastic Load Balancing resources. You can remove the tags for one or more Application Load Balancers, Network Load Balancers, Gateway Load Balancers, target groups, listeners, or rules.

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:

Callback (callback):

Returns:

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

Removes the specified revocation file from the specified trust store.

Service Reference:

Examples:

Calling the removeTrustStoreRevocations operation

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

Parameters:

Callback (callback):

Returns:

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

Sets the type of IP addresses used by the subnets of the specified load balancer.

Service Reference:

Examples:

Calling the setIpAddressType operation

var params = {
  IpAddressType: ipv4 | dualstack | dualstack-without-public-ipv4, /* 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:

Callback (callback):

Returns:

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: 'NUMBER_VALUE',
      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:

Callback (callback):

`` ``

`` `Returns:

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

Associates the specified security groups with the specified Application Load Balancer or Network Load Balancer. The specified security groups override the previously associated security groups.

You can't perform this operation on a Network Load Balancer unless you specified a security group for the load balancer when you created it.

You can't associate a security group with a Gateway Load Balancer.

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 */
  ],
  EnforceSecurityGroupInboundRulesOnPrivateLinkTraffic: on | off
};
elbv2.setSecurityGroups(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Enables the Availability Zones for the specified public subnets for the specified Application Load Balancer, Network Load Balancer or Gateway Load Balancer. The specified subnets replace the previously enabled subnets.

When you specify subnets for a Network Load Balancer, or Gateway Load Balancer you must include all subnets that were enabled previously, with their existing configurations, plus any additional 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 */
  IpAddressType: ipv4 | dualstack | dualstack-without-public-ipv4,
  SubnetMappings: [
    {
      AllocationId: 'STRING_VALUE',
      IPv6Address: 'STRING_VALUE',
      PrivateIPv4Address: 'STRING_VALUE',
      SubnetId: 'STRING_VALUE'
    },
    /* more items */
  ],
  Subnets: [
    '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:

Callback (callback):

Returns:

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:

Callback (callback):

Returns:

Waiter Resource States:

```` ````` `````` ``````` ````````` `````````` ``````````` ```````````` ````````````` `````````````` ``````````````` ```````````````` ````````````````` ``````````````````

````` ```` ## Waiter Resource Details

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

Waits for the loadBalancerExists state by periodically calling the underlyingELBv2.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:

Callback (callback):

Returns:

See Also:

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

Waits for the loadBalancerAvailable state by periodically calling the underlyingELBv2.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:

Callback (callback):

Returns:

See Also:

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

Waits for the loadBalancersDeleted state by periodically calling the underlyingELBv2.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:

Callback (callback):

Returns:

See Also:

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

Waits for the targetInService state by periodically calling the underlyingELBv2.describeTargetHealth() operation every 15 seconds (at most 40 times).

Examples:

Waiting for the targetInService state

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

Parameters:

Callback (callback):

Returns:

See Also:

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

Waits for the targetDeregistered state by periodically calling the underlyingELBv2.describeTargetHealth() operation every 15 seconds (at most 40 times).

Examples:

Waiting for the targetDeregistered state

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

Parameters:

Callback (callback):

Returns:

See Also:

```` `````