Class: AWS::ELB::LoadBalancer
- Inherits:
-
Core::Resource
- Object
- Core::Resource
- AWS::ELB::LoadBalancer
- Defined in:
- lib/aws/elb/load_balancer.rb
Instance Attribute Summary collapse
-
#availability_zone_names ⇒ Array<String>
readonly
Return the names of the availability zones this load balancer routes traffic to.
-
#canonical_hosted_zone_name ⇒ String
readonly
Provides the name of the Amazon Route 53 hosted zone that is associated with the load balancer.
-
#canonical_hosted_zone_name_id ⇒ String
readonly
Provides the ID of the Amazon Route 53 hosted zone name that is associated with the load balancer.
-
#dns_name ⇒ String
readonly
Specifies the external DNS name associated with this load balancer.
-
#name ⇒ String
readonly
The name of the load balancer.
Instance Method Summary collapse
-
#availability_zones ⇒ AvailabilityZoneCollection
A collection that help maanage the availability zones for this load balancer.
- #backend_server_policies ⇒ BackendServerPolicyCollection
-
#configure_health_check(options = {}) ⇒ Object
Updates the configuration that drives the instance health checks.
-
#delete ⇒ nil
Deletes the load balancer.
-
#exists? ⇒ Boolean
Returns true if the load balancer exists.
-
#health_check_configuration ⇒ Hash
Returns a hash of the various health probes conducted on the load balancer instances.
-
#initialize(name, options = {}) ⇒ LoadBalancer
constructor
A new instance of LoadBalancer.
- #instances ⇒ InstanceCollection
- #listeners ⇒ ListenerCollection
- #policies ⇒ PolicyCollection
-
#source_security_group ⇒ Hash
Generally you don’t need to call this method, rather you can just pass the load balancer as a source to the various authorize and revoke methods of SecurityGroup:.
Constructor Details
#initialize(name, options = {}) ⇒ LoadBalancer
Returns a new instance of LoadBalancer.
37 38 39 |
# File 'lib/aws/elb/load_balancer.rb', line 37 def initialize name, = {} super(.merge(:name => name.to_s)) end |
Instance Attribute Details
#availability_zone_names ⇒ Array<String> (readonly)
Return the names of the availability zones this load balancer routes traffic to.
35 36 37 |
# File 'lib/aws/elb/load_balancer.rb', line 35 def availability_zone_names @availability_zone_names end |
#canonical_hosted_zone_name ⇒ String (readonly)
Provides the name of the Amazon Route 53 hosted zone that is associated with the load balancer. For more information: http://docs.amazonwebservices.com/ElasticLoadBalancing/latest/DeveloperGuide/index.html?using-domain-names-with-elb.html.
35 36 37 |
# File 'lib/aws/elb/load_balancer.rb', line 35 def canonical_hosted_zone_name @canonical_hosted_zone_name end |
#canonical_hosted_zone_name_id ⇒ String (readonly)
Provides the ID of the Amazon Route 53 hosted zone name that is associated with the load balancer. For more information: http://docs.amazonwebservices.com/ElasticLoadBalancing/latest/DeveloperGuide/index.html?using-domain-names-with-elb.html.
35 36 37 |
# File 'lib/aws/elb/load_balancer.rb', line 35 def canonical_hosted_zone_name_id @canonical_hosted_zone_name_id end |
#dns_name ⇒ String (readonly)
Specifies the external DNS name associated with this load balancer.
35 36 37 |
# File 'lib/aws/elb/load_balancer.rb', line 35 def dns_name @dns_name end |
#name ⇒ String (readonly)
The name of the load balancer.
35 36 37 |
# File 'lib/aws/elb/load_balancer.rb', line 35 def name @name end |
Instance Method Details
#availability_zones ⇒ AvailabilityZoneCollection
A collection that help maanage the availability zones for this load balancer.
97 98 99 |
# File 'lib/aws/elb/load_balancer.rb', line 97 def availability_zones AvailabilityZoneCollection.new(self) end |
#backend_server_policies ⇒ BackendServerPolicyCollection
117 118 119 |
# File 'lib/aws/elb/load_balancer.rb', line 117 def backend_server_policies BackendServerPolicyCollection.new(self) end |
#configure_health_check(options = {}) ⇒ Object
Updates the configuration that drives the instance health checks.
You only need to pass the options you want to change. You can call #health_check_configuration if you want to see what the current configuration values are.
169 170 171 172 173 174 175 176 177 178 179 |
# File 'lib/aws/elb/load_balancer.rb', line 169 def configure_health_check = {} new_config = health_check_configuration.merge() response = client.configure_health_check( :load_balancer_name => name, :health_check => new_config) new_config end |
#delete ⇒ nil
Deletes the load balancer.
237 238 239 240 |
# File 'lib/aws/elb/load_balancer.rb', line 237 def delete client.delete_load_balancer(:load_balancer_name => name) nil end |
#exists? ⇒ Boolean
Returns true if the load balancer exists.
228 229 230 231 232 233 |
# File 'lib/aws/elb/load_balancer.rb', line 228 def exists? client.describe_load_balancers(:load_balancer_names => [name]) true rescue Errors::LoadBalancerNotFound false end |
#health_check_configuration ⇒ Hash
Returns a hash of the various health probes conducted on the load balancer instances. The following entries are returned:
* +:healthy_threshold+
* +:unhealthy_threshold+
* +:interval+
* +:target+
* +:timeout+
See #configure_health_check for more details on what each of the configuration values mean.
195 196 197 198 199 200 201 202 203 204 |
# File 'lib/aws/elb/load_balancer.rb', line 195 def health_check_configuration cfg = health_check_description { :healthy_threshold => cfg.healthy_threshold, :unhealthy_threshold => cfg.unhealthy_threshold, :interval => cfg.interval, :target => cfg.target, :timeout => cfg.timeout, } end |
#instances ⇒ InstanceCollection
112 113 114 |
# File 'lib/aws/elb/load_balancer.rb', line 112 def instances InstanceCollection.new(self) end |
#listeners ⇒ ListenerCollection
102 103 104 |
# File 'lib/aws/elb/load_balancer.rb', line 102 def listeners ListenerCollection.new(self) end |
#policies ⇒ PolicyCollection
107 108 109 |
# File 'lib/aws/elb/load_balancer.rb', line 107 def policies LoadBalancerPolicyCollection.new(self) end |
#source_security_group ⇒ Hash
Generally you don’t need to call this method, rather you can just pass the load balancer as a source to the various authorize and revoke methods of SecurityGroup:
security_group.(load_balancer)
security_group.revoke_ingress(load_balancer)
220 221 222 223 224 225 |
# File 'lib/aws/elb/load_balancer.rb', line 220 def source_security_group { :group_name => security_group_description.group_name, :user_id => security_group_description.owner_alias, } end |