Skip to content

Client

elb R Documentation

Elastic Load Balancing

Description

A load balancer can distribute incoming traffic across your EC2 instances. This enables you to increase the availability of your application. The load balancer also monitors the health of its registered instances and ensures that it routes traffic only to healthy instances. You configure your load balancer to accept incoming traffic by specifying one or more listeners, which are configured with a protocol and port number for connections from clients to the load balancer and a protocol and port number for connections from the load balancer to the instances.

Elastic Load Balancing supports three types of load balancers: Application Load Balancers, Network Load Balancers, and Classic Load Balancers. You can select a load balancer based on your application needs. For more information, see the Elastic Load Balancing User Guide.

This reference covers the 2012-06-01 API, which supports Classic Load Balancers. The 2015-12-01 API supports Application Load Balancers and Network Load Balancers.

To get started, create a load balancer with one or more listeners using create_load_balancer. Register your instances with the load balancer using register_instances_with_load_balancer.

All Elastic Load Balancing operations are idempotent, which means that they complete at most one time. If you repeat an operation, it succeeds with a 200 OK response code.

Usage

elb(config = list(), credentials = list(), endpoint = NULL, region = NULL)

Arguments

config

Optional configuration of credentials, endpoint, and/or region.

  • credentials:

    • creds:

      • access_key_id: AWS access key ID

      • secret_access_key: AWS secret access key

      • session_token: AWS temporary session token

    • profile: The name of a profile to use. If not given, then the default profile is used.

    • anonymous: Set anonymous credentials.

  • endpoint: The complete URL to use for the constructed client.

  • region: The AWS Region used in instantiating the client.

  • close_connection: Immediately close all HTTP connections.

  • timeout: The time in seconds till a timeout exception is thrown when attempting to make a connection. The default is 60 seconds.

  • s3_force_path_style: Set this to true to force the request to use path-style addressing, i.e. ⁠http://s3.amazonaws.com/BUCKET/KEY⁠.

  • sts_regional_endpoint: Set sts regional endpoint resolver to regional or legacy https://docs.aws.amazon.com/sdkref/latest/guide/feature-sts-regionalized-endpoints.html

credentials

Optional credentials shorthand for the config parameter

  • creds:

    • access_key_id: AWS access key ID

    • secret_access_key: AWS secret access key

    • session_token: AWS temporary session token

  • profile: The name of a profile to use. If not given, then the default profile is used.

  • anonymous: Set anonymous credentials.

endpoint

Optional shorthand for complete URL to use for the constructed client.

region

Optional shorthand for AWS Region used in instantiating the client.

Value

A client for the service. You can call the service's operations using syntax like svc$operation(...), where svc is the name you've assigned to the client. The available operations are listed in the Operations section.

Service syntax

svc <- elb(
  config = list(
    credentials = list(
      creds = list(
        access_key_id = "string",
        secret_access_key = "string",
        session_token = "string"
      ),
      profile = "string",
      anonymous = "logical"
    ),
    endpoint = "string",
    region = "string",
    close_connection = "logical",
    timeout = "numeric",
    s3_force_path_style = "logical",
    sts_regional_endpoint = "string"
  ),
  credentials = list(
    creds = list(
      access_key_id = "string",
      secret_access_key = "string",
      session_token = "string"
    ),
    profile = "string",
    anonymous = "logical"
  ),
  endpoint = "string",
  region = "string"
)

Operations

add_tags
Adds the specified tags to the specified load balancer
apply_security_groups_to_load_balancer
Associates one or more security groups with your load balancer in a virtual private cloud (VPC)
attach_load_balancer_to_subnets
Adds one or more subnets to the set of configured subnets for the specified load balancer
configure_health_check
Specifies the health check settings to use when evaluating the health state of your EC2 instances
create_app_cookie_stickiness_policy
Generates a stickiness policy with sticky session lifetimes that follow that of an application-generated cookie
create_lb_cookie_stickiness_policy
Generates a stickiness policy with sticky session lifetimes controlled by the lifetime of the browser (user-agent) or a specified expiration period
create_load_balancer
Creates a Classic Load Balancer
create_load_balancer_listeners
Creates one or more listeners for the specified load balancer
create_load_balancer_policy
Creates a policy with the specified attributes for the specified load balancer
delete_load_balancer
Deletes the specified load balancer
delete_load_balancer_listeners
Deletes the specified listeners from the specified load balancer
delete_load_balancer_policy
Deletes the specified policy from the specified load balancer
deregister_instances_from_load_balancer
Deregisters the specified instances from the specified load balancer
describe_account_limits
Describes the current Elastic Load Balancing resource limits for your AWS account
describe_instance_health
Describes the state of the specified instances with respect to the specified load balancer
describe_load_balancer_attributes
Describes the attributes for the specified load balancer
describe_load_balancer_policies
Describes the specified policies
describe_load_balancer_policy_types
Describes the specified load balancer policy types or all load balancer policy types
describe_load_balancers
Describes the specified the load balancers
describe_tags
Describes the tags associated with the specified load balancers
detach_load_balancer_from_subnets
Removes the specified subnets from the set of configured subnets for the load balancer
disable_availability_zones_for_load_balancer
Removes the specified Availability Zones from the set of Availability Zones for the specified load balancer in EC2-Classic or a default VPC
enable_availability_zones_for_load_balancer
Adds the specified Availability Zones to the set of Availability Zones for the specified load balancer in EC2-Classic or a default VPC
modify_load_balancer_attributes
Modifies the attributes of the specified load balancer
register_instances_with_load_balancer
Adds the specified instances to the specified load balancer
remove_tags
Removes one or more tags from the specified load balancer
set_load_balancer_listener_ssl_certificate
Sets the certificate that terminates the specified listener's SSL connections
set_load_balancer_policies_for_backend_server
Replaces the set of policies associated with the specified port on which the EC2 instance is listening with a new set of policies
set_load_balancer_policies_of_listener
Replaces the current set of policies for the specified load balancer port with the specified set of policies

Examples

## Not run: 
svc <- elb()
# This example adds two tags to the specified load balancer.
svc$add_tags(
  LoadBalancerNames = list(
    "my-load-balancer"
  ),
  Tags = list(
    list(
      Key = "project",
      Value = "lima"
    ),
    list(
      Key = "department",
      Value = "digital-media"
    )
  )
)

## End(Not run)