You are viewing documentation for version 1 of the AWS SDK for Ruby. Version 2 documentation can be found here.
Class: AWS::EC2::AvailabilityZone
- Inherits:
-
Resource
- Object
- Core::Resource
- Resource
- AWS::EC2::AvailabilityZone
- Defined in:
- lib/aws/ec2/availability_zone.rb
Overview
Represents an EC2 availability zone. You can use this class to get information about the state of an availability zone that is available to your account.
Instance Attribute Summary collapse
-
#messages ⇒ Array<String>
readonly
Returns a list of messages about the Availability Zone.
-
#name ⇒ String
(also: #to_s, #to_str)
readonly
Returns the name of the availability zone, e.g.
-
#region_name ⇒ String?
readonly
Returns the region name of the availability zone.
-
#state ⇒ Symbol
readonly
Returns the state of the availability zone, e.g.
Instance Method Summary collapse
-
#initialize(name, options = {}) ⇒ AvailabilityZone
constructor
A new instance of AvailabilityZone.
-
#region ⇒ Region
Returns the region of this availability zone.
Constructor Details
#initialize(name, options = {}) ⇒ AvailabilityZone
Returns a new instance of AvailabilityZone
33 34 35 36 37 38 39 |
# File 'lib/aws/ec2/availability_zone.rb', line 33 def initialize name, = {} @name = name if [:region] [:region_name] = [:region].name end super end |
Instance Attribute Details
#messages ⇒ Array<String> (readonly)
Returns a list of messages about the Availability Zone.
30 31 32 |
# File 'lib/aws/ec2/availability_zone.rb', line 30 def @messages end |
#name ⇒ String (readonly) Also known as: to_s, to_str
Returns the name of the availability zone, e.g. "us-west-2a".
43 44 45 |
# File 'lib/aws/ec2/availability_zone.rb', line 43 def name @name end |
#region_name ⇒ String? (readonly)
Returns the region name of the availability zone.
30 31 32 |
# File 'lib/aws/ec2/availability_zone.rb', line 30 def region_name @region_name end |
#state ⇒ Symbol (readonly)
Returns the state of the availability
zone, e.g. :available
.
30 31 32 |
# File 'lib/aws/ec2/availability_zone.rb', line 30 def state @state end |
Instance Method Details
#region ⇒ Region
Returns the region of this availability zone.
64 65 66 |
# File 'lib/aws/ec2/availability_zone.rb', line 64 def region Region.new(self.region_name, :config => config) end |