Class | Fog::AWS::ELB::Real
In: | lib/fog/aws/elb.rb lib/fog/aws/requests/elb/apply_security_groups_to_load_balancer.rb lib/fog/aws/requests/elb/create_lb_cookie_stickiness_policy.rb lib/fog/aws/requests/elb/delete_load_balancer_policy.rb lib/fog/aws/requests/elb/describe_load_balancers.rb lib/fog/aws/requests/elb/deregister_instances_from_load_balancer.rb lib/fog/aws/requests/elb/set_load_balancer_policies_of_listener.rb lib/fog/aws/requests/elb/create_load_balancer.rb lib/fog/aws/requests/elb/delete_load_balancer_listeners.rb lib/fog/aws/requests/elb/attach_load_balancer_to_subnets.rb lib/fog/aws/requests/elb/create_load_balancer_listeners.rb lib/fog/aws/requests/elb/detach_load_balancer_from_subnets.rb lib/fog/aws/requests/elb/configure_health_check.rb lib/fog/aws/requests/elb/describe_load_balancer_policies.rb lib/fog/aws/requests/elb/create_load_balancer_policy.rb lib/fog/aws/requests/elb/describe_load_balancer_policy_types.rb lib/fog/aws/requests/elb/describe_instance_health.rb lib/fog/aws/requests/elb/set_load_balancer_listener_ssl_certificate.rb lib/fog/aws/requests/elb/disable_availability_zones_for_load_balancer.rb lib/fog/aws/requests/elb/enable_availability_zones_for_load_balancer.rb lib/fog/aws/requests/elb/register_instances_with_load_balancer.rb lib/fog/aws/requests/elb/delete_load_balancer.rb lib/fog/aws/requests/elb/create_app_cookie_stickiness_policy.rb
Parent: | Object

### Methods

apply_security_groups apply_security_groups_to_load_balancer attach_load_balancer_to_subnets configure_health_check create_app_cookie_stickiness_policy create_lb_cookie_stickiness_policy create_load_balancer create_load_balancer_listeners create_load_balancer_policy delete_load_balancer delete_load_balancer_listeners delete_load_balancer_policy deregister_instances deregister_instances_from_load_balancer describe_instance_health describe_load_balancer_policies describe_load_balancer_policy_types describe_load_balancers detach_load_balancer_from_subnets disable_availability_zones_for_load_balancer disable_subnets disable_zones enable_availability_zones_for_load_balancer enable_subnets enable_zones new register_instances register_instances_with_load_balancer reload set_load_balancer_listener_ssl_certificate set_load_balancer_policies_of_listener

### Included Modules

Fog::AWS::CredentialFetcher::ConnectionMethods

### Public Class methods

new(options={})

Initialize connection to ELB

#### Notes

options parameter must include values for :aws_access_key_id and :aws_secret_access_key in order to create a connection

#### Examples

      elb = ELB.new(
       :aws_access_key_id => your_aws_access_key_id,
       :aws_secret_access_key => your_aws_secret_access_key
      )

#### Parameters

- options<~Hash> - config arguments for connection. Defaults to {}.
  - region<~String> - optional region to use. For instance, ‘eu-west-1’, ‘us-east-1’, etc.

#### Returns

- ELB object with connection to AWS.

### Public Instance methods

apply_security_groups(security_group_ids, lb_name)

Alias for apply_security_groups_to_load_balancer

apply_security_groups_to_load_balancer(security_group_ids, lb_name)

Sets the security groups for an ELB in VPC

#### Parameters

- security_group_ids<~Array> - List of security group ids to enable on ELB
- lb_name<~String> - Load balancer to disable availability zones on

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘ResponseMetadata’<~Hash>:
      - ‘RequestId’<~String> - Id of request
    - ‘ApplySecurityGroupsToLoadBalancer’<~Hash>:
      - ‘SecurityGroups’<~Array> - array of strings describing the security group ids currently enabled

attach_load_balancer_to_subnets(subnet_ids, lb_name)

Enable a subnet for an existing ELB

#### Parameters

- subnet_ids<~Array> - List of subnet ids to enable on ELB
- lb_name<~String> - Load balancer to enable availability zones on

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘ResponseMetadata’<~Hash>:
      - ‘RequestId’<~String> - Id of request
    - ‘AttachLoadBalancerToSubnetsResult’<~Hash>:
      - ‘Subnets’<~Array> - array of strings describing the subnet ids currently enabled

configure_health_check(lb_name, health_check)

Enables the client to define an application healthcheck for the instances. See docs.amazonwebservices.com/ElasticLoadBalancing/latest/APIReference/index.html?API_ConfigureHealthCheck.html

#### Parameters

- lb_name<~String> - Name of the ELB
- health_check<~Hash> - A hash of parameters describing the health check
  - ‘HealthyThreshold’<~Integer> - Specifies the number of consecutive health probe successes required before moving the instance to the Healthy state.
  - ‘Interval’<~Integer> - Specifies the approximate interval, in seconds, between health checks of an individual instance.
  - ‘Target’<~String> - Specifies the instance being checked. The protocol is either TCP or HTTP. The range of valid ports is one (1) through 65535.
  - ‘Timeout’<~Integer> - Specifies the amount of time, in seconds,

  during which no response means a failed health probe.

  - ‘UnhealthyThreshold’<~Integer> - Specifies the number of consecutive health probe failures required before moving the instance to the Unhealthy state.

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:

create_app_cookie_stickiness_policy(lb_name, policy_name, cookie_name)

Create an app cookie stickiness policy

#### Parameters

- lb_name<~String> - Name of the ELB
- policy_name<~String> - The name of the policy being created. The name must be unique within the set of policies for this Load Balancer.
- cookie_name<~String> - Name of the application cookie used for stickiness.

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘ResponseMetadata’<~Hash>:
      - ‘RequestId’<~String> - Id of request

create_lb_cookie_stickiness_policy(lb_name, policy_name, cookie_expiration_period=nil)

Create a Load Balancer Cookie Stickiness Policy

#### Parameters

- lb_name<~String> - Name of the ELB
- policy_name<~String> - The name of the policy being created. The name must be unique within the set of policies for this Load Balancer.
- cookie_expiration_period<~Integer> - The time period in seconds after which the cookie should be considered stale. Not specifying this parameter indicates that the sticky session will last for the duration of the browser session.

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘ResponseMetadata’<~Hash>:
      - ‘RequestId’<~String> - Id of request

create_load_balancer(availability_zones, lb_name, listeners, options = {})

Create a new Elastic Load Balancer

#### Parameters

- availability_zones<~Array> - List of availability zones for the ELB
- lb_name<~String> - Name for the new ELB — must be unique
- listeners<~Array> - Array of Hashes describing ELB listeners to assign to the ELB
  - ‘Protocol’<~String> - Protocol to use. Either HTTP, HTTPS, TCP or SSL.
  - ‘LoadBalancerPort’<~Integer> - The port that the ELB will listen to for outside traffic
  - ‘InstancePort’<~Integer> - The port on the instance that the ELB will forward traffic to
  - ‘InstanceProtocol’<~String> - Protocol for sending traffic to an instance. Either HTTP, HTTPS, TCP or SSL.
  - ‘SSLCertificateId’<~String> - ARN of the server certificate

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘ResponseMetadata’<~Hash>:
      - ‘RequestId’<~String> - Id of request
    - ‘CreateLoadBalancerResult’<~Hash>:
      - ‘DNSName’<~String> - DNS name for the newly created ELB

create_load_balancer_listeners(lb_name, listeners)

Create Elastic Load Balancer Listeners

#### Parameters

- lb_name<~String> - Name for the new ELB — must be unique
- listeners<~Array> - Array of Hashes describing ELB listeners to add to the ELB
  - ‘Protocol’<~String> - Protocol to use. Either HTTP, HTTPS, TCP or SSL.
  - ‘LoadBalancerPort’<~Integer> - The port that the ELB will listen to for outside traffic
  - ‘InstancePort’<~Integer> - The port on the instance that the ELB will forward traffic to
  - ‘InstanceProtocol’<~String> - Protocol for sending traffic to an instance. Either HTTP, HTTPS, TCP or SSL.
  - ‘SSLCertificateId’<~String> - ARN of the server certificate

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘ResponseMetadata’<~Hash>:
      - ‘RequestId’<~String> - Id of request

create_load_balancer_policy(lb_name, name, type_name, attributes = {})

Create Elastic Load Balancer Policy

#### Parameters

- lb_name<~String> - The name associated with the LoadBalancer for which the policy is being created. This name must be unique within the client AWS account.
- attributes<~Hash> - A list of attributes associated with the policy being created.
  - ‘AttributeName’<~String> - The name of the attribute associated with the policy.
  - ‘AttributeValue’<~String> - The value of the attribute associated with the policy.
- name<~String> - The name of the LoadBalancer policy being created. The name must be unique within the set of policies for this LoadBalancer.
- type_name<~String> - The name of the base policy type being used to create this policy. To get the list of policy types, use the DescribeLoadBalancerPolicyTypes action.

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘ResponseMetadata’<~Hash>:
      - ‘RequestId’<~String> - Id of request

delete_load_balancer(lb_name)

Delete an existing Elastic Load Balancer

Note that this API call, as defined by Amazon, is idempotent. That is, it will not return an error if you try to delete an ELB that does not exist.

#### Parameters

- lb_name<~String> - Name of the ELB to be deleted

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘DeleteLoadBalancerResponse’<~nil>
    - ‘ResponseMetadata’<~Hash>:
      - ‘RequestId’<~String> - Id of request

delete_load_balancer_listeners(lb_name, load_balancer_ports)

Delet Elastic Load Balancer Listeners

#### Parameters

- lb_name<~String> - Name for the new ELB — must be unique
- load_balancer_ports<~Array> - Array of client port numbers of the LoadBalancerListeners to remove

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘ResponseMetadata’<~Hash>:
      - ‘RequestId’<~String> - Id of request

delete_load_balancer_policy(lb_name, policy_name)

Delete a Load Balancer Stickiness Policy

#### Parameters

- lb_name<~String> - Name of the ELB
- policy_name<~String> - The name of the policy to delete

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘ResponseMetadata’<~Hash>:
      - ‘RequestId’<~String> - Id of request

deregister_instances(instance_ids, lb_name)

Alias for deregister_instances_from_load_balancer

deregister_instances_from_load_balancer(instance_ids, lb_name)

Deregister an instance from an existing ELB

#### Parameters

- instance_ids<~Array> - List of instance IDs to remove from ELB
- lb_name<~String> - Load balancer to remove instances from

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘ResponseMetadata’<~Hash>:
      - ‘RequestId’<~String> - Id of request
    - ‘DeregisterInstancesFromLoadBalancerResult’<~Hash>:
      - ‘Instances’<~Array> - array of hashes describing instances currently enabled
        - ‘InstanceId’<~String>

describe_instance_health(lb_name, instance_ids = [])

Get health status for one or more instances on an existing ELB

#### Parameters

- lb_name<~String> - Load balancer to check instances health on
- instance_ids<~Array> - Optional list of instance IDs to check

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘ResponseMetadata’<~Hash>:
      - ‘RequestId’<~String> - Id of request
    - ‘DescribeInstanceHealthResult’<~Hash>:
      - ‘InstanceStates’<~Array> - array of hashes describing instance health
        - ‘Description’<~String>
        - ‘State’<~String>
        - ‘InstanceId’<~String>
        - ‘ReasonCode’<~String>

describe_load_balancer_policies(lb_name = nil, names = [])

Describe all or specified load balancer policies

#### Parameters

- lb_name<~String> - The mnemonic name associated with the LoadBalancer. If no name is specified, the operation returns the attributes of either all the sample policies pre-defined by Elastic Load Balancing or the specified sample polices.
- names<~Array> - The names of LoadBalancer policies you‘ve created or Elastic Load Balancing sample policy names.

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘ResponseMetadata’<~Hash>:
      - ‘RequestId’<~String> - Id of request
    - ‘DescribeLoadBalancerPoliciesResult’<~Hash>:
      - ‘PolicyDescriptions’<~Array>
        - ‘PolicyAttributeDescriptions’<~Array>
          - ‘AttributeName’<~String> - The name of the attribute associated with the policy.
          - ‘AttributeValue’<~String> - The value of the attribute associated with the policy.
        - ‘PolicyName’<~String> - The name mof the policy associated with the LoadBalancer.
        - ‘PolicyTypeName’<~String> - The name of the policy type.

describe_load_balancer_policy_types(type_names = [])

Describe all or specified load balancer policy types

#### Parameters

- type_name<~Array> - Specifies the name of the policy types. If no names are specified, returns the description of all the policy types defined by Elastic Load Balancing service.

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘ResponseMetadata’<~Hash>:
      - ‘RequestId’<~String> - Id of request
    - ‘DescribeLoadBalancerPolicyTypesResult’<~Hash>:
      - ‘PolicyTypeDescriptions’<~Array>
        - ‘Description’<~String> - A human-readable description of the policy type.
        - ‘PolicyAttributeTypeDescriptions’<~Array>
          - ‘AttributeName’<~String> - The name of the attribute associated with the policy type.
          - ‘AttributeValue’<~String> - The type of attribute. For example, Boolean, Integer, etc.
          - ‘Cardinality’<~String> - The cardinality of the attribute.
          - ‘DefaultValue’<~String> - The default value of the attribute, if applicable.
          - ‘Description’<~String> - A human-readable description of the attribute.
        - ‘PolicyTypeName’<~String> - The name of the policy type.

describe_load_balancers(options = {})

Describe all or specified load balancers

#### Parameters

- options<~Hash>
  - ‘LoadBalancerNames’<~Array> - List of load balancer names to describe, defaults to all
  - ‘Marker’<String> - Indicates where to begin in your list of load balancers

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘ResponseMetadata’<~Hash>:
      - ‘RequestId’<~String> - Id of request
    - ‘DescribeLoadBalancersResult’<~Hash>:
      - ‘LoadBalancerDescriptions’<~Array>
        - ‘AvailabilityZones’<~Array> - list of availability zones covered by this load balancer
        - ‘CanonicalHostedZoneName’<~String> - name of the Route 53 hosted zone associated with the load balancer
        - ‘CanonicalHostedZoneNameID’<~String> - ID of the Route 53 hosted zone associated with the load balancer
        - ‘CreatedTime’<~Time> - time load balancer was created
        - ‘DNSName’<~String> - external DNS name of load balancer
        - ‘HealthCheck’<~Hash>:
          - ‘HealthyThreshold’<~Integer> - number of consecutive health probe successes required before moving the instance to the Healthy state
          - ‘Timeout’<~Integer> - number of seconds after which no response means a failed health probe
          - ‘Interval’<~Integer> - interval (in seconds) between health checks of an individual instance
          - ‘UnhealthyThreshold’<~Integer> - number of consecutive health probe failures that move the instance to the unhealthy state
          - ‘Target’<~String> - string describing protocol type, port and URL to check
        - ‘Instances’<~Array> - list of instances that the load balancer balances between
        - ‘ListenerDescriptions’<~Array>
          - ‘PolicyNames’<~Array> - list of policies enabled
          - ‘Listener’<~Hash>:
            - ‘InstancePort’<~Integer> - port on instance that requests are sent to
            - ‘Protocol’<~String> - transport protocol used for routing in [TCP, HTTP]
            - ‘LoadBalancerPort’<~Integer> - port that load balancer listens on for requests
        - ‘LoadBalancerName’<~String> - name of load balancer
        - ‘Policies’<~Hash>:
          - ‘LBCookieStickinessPolicies’<~Array> - list of Load Balancer Generated Cookie Stickiness policies for the LoadBalancer
          - ‘AppCookieStickinessPolicies’<~Array> - list of Application Generated Cookie Stickiness policies for the LoadBalancer
        - ‘SourceSecurityGroup’<~Hash>:
          - ‘GroupName’<~String> - Name of the source security group to use with inbound security group rules
          - ‘OwnerAlias’<~String> - Owner of the source security group
        - ‘NextMarker’<~String> - Marker to specify for next page

detach_load_balancer_from_subnets(subnet_ids, lb_name)

Disable a subnet for an existing ELB

#### Parameters

- subnet_ids<~Array> - List of subnet ids to enable on ELB
- lb_name<~String> - Load balancer to disable availability zones on

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘ResponseMetadata’<~Hash>:
      - ‘RequestId’<~String> - Id of request
    - ‘DetachLoadBalancerFromSubnetsResult’<~Hash>:
      - ‘Subnets’<~Array> - array of strings describing the subnet ids currently enabled

disable_availability_zones_for_load_balancer(availability_zones, lb_name)

Disable an availability zone for an existing ELB

#### Parameters

- availability_zones<~Array> - List of availability zones to disable on ELB
- lb_name<~String> - Load balancer to disable availability zones on

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘ResponseMetadata’<~Hash>:
      - ‘RequestId’<~String> - Id of request
    - ‘DisableAvailabilityZonesForLoadBalancerResult’<~Hash>:
      - ‘AvailabilityZones’<~Array> - A list of updated Availability Zones for the LoadBalancer.

disable_subnets(subnet_ids, lb_name)

Alias for detach_load_balancer_from_subnets

disable_zones(availability_zones, lb_name)

Alias for disable_availability_zones_for_load_balancer

enable_availability_zones_for_load_balancer(availability_zones, lb_name)

Enable an availability zone for an existing ELB

#### Parameters

- availability_zones<~Array> - List of availability zones to enable on ELB
- lb_name<~String> - Load balancer to enable availability zones on

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘ResponseMetadata’<~Hash>:
      - ‘RequestId’<~String> - Id of request
    - ‘EnableAvailabilityZonesForLoadBalancerResult’<~Hash>:
      - ‘AvailabilityZones’<~Array> - array of strings describing instances currently enabled

enable_subnets(subnet_ids, lb_name)

Alias for attach_load_balancer_to_subnets

enable_zones(availability_zones, lb_name)

Alias for enable_availability_zones_for_load_balancer

register_instances(instance_ids, lb_name)

Alias for register_instances_with_load_balancer

register_instances_with_load_balancer(instance_ids, lb_name)

Register an instance with an existing ELB

#### Parameters

- instance_ids<~Array> - List of instance IDs to associate with ELB
- lb_name<~String> - Load balancer to assign instances to

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘ResponseMetadata’<~Hash>:
      - ‘RequestId’<~String> - Id of request
    - ‘RegisterInstancesWithLoadBalancerResult’<~Hash>:
      - ‘Instances’<~Array> - array of hashes describing instances currently enabled
        - ‘InstanceId’<~String>

reload()
set_load_balancer_listener_ssl_certificate(lb_name, load_balancer_port, ssl_certificate_id)

Sets the certificate that terminates the specified listener‘s SSL connections. The specified certificate replaces any prior certificate that was used on the same LoadBalancer and port.

#### Parameters

- lb_name<~String> - Name of the ELB
- load_balancer_port<~Integer> - The external port of the LoadBalancer with which this policy has to be associated.
- ssl_certificate_id<~String> - ID of the SSL certificate chain to use example: arn:aws:iam::322191361670:server-certificate/newCert

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘ResponseMetadata’<~Hash>:
      - ‘RequestId’<~String> - Id of request

set_load_balancer_policies_of_listener(lb_name, load_balancer_port, policy_names)

- policy_names<~Array> - List of policies to be associated with the listener. Currently this list can have at most one policy. If the list is empty, the current policy is removed from the listener.

#### Returns

- response<~Excon::Response>:
  - body<~Hash>:
    - ‘ResponseMetadata’<~Hash>:
      - ‘RequestId’<~String> - Id of request

[Validate]