Class: AWS::EC2::AvailabilityZone

Inherits:
Resource
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}) ⇒ AvailabilityZone

Returns a new instance of AvailabilityZone.

Parameters:

  • name (String)

    The name of the availability zone.



35
36
37
38
39
40
41
42
# File 'lib/aws/ec2/availability_zone.rb', line 35

def initialize name, options = {}
  @name = name
  if options[:region]
    options[:region_name] = options[:region].name
    
  end
  super
end

Instance Attribute Details

#messagesArray<String> (readonly)

Returns a list of messages about the Availability Zone.

Returns:

  • (Array<String>)

    the current value of messages



32
33
34
# File 'lib/aws/ec2/availability_zone.rb', line 32

def messages
  @messages
end

#nameString (readonly) Also known as: to_s, to_str

Returns the name of the availability zone, e.g. “us-east-1a”.

Returns:

  • (String)

    Returns the name of the availability zone, e.g. “us-east-1a”.



46
47
48
# File 'lib/aws/ec2/availability_zone.rb', line 46

def name
  @name
end

#region_nameString? (readonly)

Returns the region name of the availability zone.

Returns:

  • (String, nil)

    the current value of region_name



32
33
34
# File 'lib/aws/ec2/availability_zone.rb', line 32

def region_name
  @region_name
end

#stateSymbol (readonly)

Returns the state of the availability zone, e.g. :available.

Returns:

  • (Symbol)

    the current value of state



32
33
34
# File 'lib/aws/ec2/availability_zone.rb', line 32

def state
  @state
end

Instance Method Details

#regionRegion

Returns the region of this availability zone.

Returns:

  • (Region)

    Returns the region of this availability zone.



67
68
69
# File 'lib/aws/ec2/availability_zone.rb', line 67

def region
  Region.new(self.region_name, :config => config)
end