Module: AwsExtensions::EC2::Instance
- Defined in:
- lib/aws_extensions/ec2/Instance.rb
Instance Method Summary collapse
-
#name ⇒ Object
Public: Returns the value of the “Name” tag for the Instance.
-
#nonroot_devices ⇒ Object
Public: Returns an array of the block device mappings that are not for the root device.
-
#stopped? ⇒ Boolean
Public: Returns true if the instance is stopped.
-
#terminated? ⇒ Boolean
Public: Returns true if the instance is terminated.
Instance Method Details
#name ⇒ Object
Public: Returns the value of the “Name” tag for the Instance
6 7 8 9 10 |
# File 'lib/aws_extensions/ec2/Instance.rb', line 6 def name self..select { |tag| tag.key == "Name" }.first.value rescue nil end |
#nonroot_devices ⇒ Object
Public: Returns an array of the block device mappings that are not for the root device
13 14 15 |
# File 'lib/aws_extensions/ec2/Instance.rb', line 13 def nonroot_devices self.block_device_mappings.reject { |m| m.device_name == self.root_device_name } end |
#stopped? ⇒ Boolean
Public: Returns true if the instance is stopped
18 19 20 |
# File 'lib/aws_extensions/ec2/Instance.rb', line 18 def stopped? self.state.name == "stopped" end |
#terminated? ⇒ Boolean
Public: Returns true if the instance is terminated
23 24 25 |
# File 'lib/aws_extensions/ec2/Instance.rb', line 23 def terminated? self.state.name == "terminated" end |