module AwsExtensions::EC2::Volume

Public Instance Methods

attached?() click to toggle source

Public: Returns true if the volume is attached or attaching to anything

# File lib/aws_extensions/ec2/Volume.rb, line 13
def attached?
  self.attachments.map(&:state).any? { |state| state == "attached" || state == "attaching" }
end
detached?() click to toggle source

Public: Returns true if the volume is not attached or attaching to anything

# File lib/aws_extensions/ec2/Volume.rb, line 18
def detached?
  !self.attached?
end
group() click to toggle source

Public: Returns the value of the “Group” tag for the Volume

# File lib/aws_extensions/ec2/Volume.rb, line 6
def group
  self.tags.select { |tag| tag.key == "Group" }.first.value
rescue
  nil
end