Module: AwsExtensions::EC2::Instance

Defined in:
lib/aws_extensions/ec2/Instance.rb

Instance Method Summary collapse

Instance Method Details

#nameObject

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.tags.select { |tag| tag.key == "Name" }.first.value
rescue
	nil
end

#nonroot_devicesObject

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

Returns:

  • (Boolean)


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

Returns:

  • (Boolean)


23
24
25
# File 'lib/aws_extensions/ec2/Instance.rb', line 23

def terminated?
  self.state.name == "terminated"
end