Class: Chef::Resource::AwsLoadBalancer

Inherits:
Provisioning::AWSDriver::AWSResource show all
Includes:
Provisioning::AWSDriver::AWSTaggable
Defined in:
lib/chef/resource/aws_load_balancer.rb

Constant Summary

Constants inherited from Provisioning::AWSDriver::AWSResource

Provisioning::AWSDriver::AWSResource::NOT_PASSED

Instance Method Summary collapse

Methods included from Provisioning::AWSDriver::AWSTaggable

included

Methods inherited from Provisioning::AWSDriver::AWSResource

#action, #action=, #aws_object_id, get_aws_object, get_aws_object_id, #initialize, lookup_options

Methods inherited from Provisioning::AWSDriver::SuperLWRP

#_pv_is, attribute, lazy

Constructor Details

This class inherits a constructor from Chef::Provisioning::AWSDriver::AWSResource

Instance Method Details

#aws_objectObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/chef/resource/aws_load_balancer.rb', line 15

def aws_object
  result = nil
  begin
    result = driver.elb.describe_load_balancers(load_balancer_names: [name]).load_balancer_descriptions
    if result.length == 1
      result = result[0]
    else
      raise "Must have 0 or 1 load balancers which match name!"
    end
  rescue ::Aws::ElasticLoadBalancing::Errors::LoadBalancerNotFound
    Chef::Log.debug("No loadbalancer named #{name} - returning nil!")
    result = nil
  end
  result
end