module AwsExtensions::EC2::Instance

Public Instance Methods

name() click to toggle source

Public: Returns the value of the “Name” tag for the Instance

# File lib/aws_extensions/ec2/Instance.rb, line 6
def name
  self.tags.select { |tag| tag.key == "Name" }.first.value
rescue
  nil
end
nonroot_devices() click to toggle source

Public: Returns an array of the block device mappings that are not for the root device

# 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?() click to toggle source

Public: Returns true if the instance is stopped

# File lib/aws_extensions/ec2/Instance.rb, line 18
def stopped?
  self.state.name == "stopped"
end
terminated?() click to toggle source

Public: Returns true if the instance is terminated

# File lib/aws_extensions/ec2/Instance.rb, line 23
def terminated?
  self.state.name == "terminated"
end