Module: Awspec::Helper::Finder::Elb
- Included in:
- Awspec::Helper::Finder
- Defined in:
- lib/awspec/helper/finder/elb.rb
Instance Method Summary collapse
- #find_elb(id) ⇒ Object
- #find_elb_attribute(id) ⇒ Object
- #select_all_elb_tags(id) ⇒ Object
- #select_elb_by_vpc_id(vpc_id) ⇒ Object
Instance Method Details
#find_elb(id) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/awspec/helper/finder/elb.rb', line 6 def find_elb(id) res = elb_client.describe_load_balancers({ load_balancer_names: [id] }) res.load_balancer_descriptions.single_resource(id) rescue StandardError nil end |
#find_elb_attribute(id) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/awspec/helper/finder/elb.rb', line 15 def find_elb_attribute(id) res = elb_client.describe_load_balancer_attributes({ load_balancer_name: id }) res.load_balancer_attributes rescue StandardError nil end |
#select_all_elb_tags(id) ⇒ Object
31 32 33 34 35 36 |
# File 'lib/awspec/helper/finder/elb.rb', line 31 def (id) res = elb_client.({ load_balancer_names: [id] }) res.tag_descriptions.single_resource(id). end |
#select_elb_by_vpc_id(vpc_id) ⇒ Object
24 25 26 27 28 29 |
# File 'lib/awspec/helper/finder/elb.rb', line 24 def select_elb_by_vpc_id(vpc_id) res = elb_client.describe_load_balancers res.load_balancer_descriptions.select do |lb| lb.vpc_id == vpc_id end end |