Class: AWS::EC2::AvailabilityZoneCollection

Inherits:
Collection
  • Object
show all
Defined in:
lib/aws/ec2/availability_zone_collection.rb

Overview

Represents all EC2 availability zones that are currently available to your account.

Instance Attribute Summary

Attributes included from Core::Model

#config

Instance Method Summary collapse

Methods inherited from Collection

#[]

Methods included from FilteredCollection

#filter, #filtered_request, #initialize

Methods included from Core::Model

#client, #config_prefix, #initialize, #inspect

Instance Method Details

#each(&block) ⇒ nil

Yields each of the EC2 availability zones.

Returns:

  • (nil)


23
24
25
26
27
28
29
30
31
32
# File 'lib/aws/ec2/availability_zone_collection.rb', line 23

def each &block
  resp = filtered_request(:describe_availability_zones)
  resp.availability_zone_info.each do |az|
    zone = AvailabilityZone.new(az.zone_name,
      :region_name => az.region_name,
      :config => config)
    yield(zone)
  end
  nil
end