class Awspec::Type::Ebs

Constants

STATES

Public Class Methods

new(name) click to toggle source
Calls superclass method
# File lib/awspec/type/ebs.rb, line 8
def initialize(name)
  super
  @display_name = name
end

Public Instance Methods

attached_to?(instance_id) click to toggle source
# File lib/awspec/type/ebs.rb, line 31
def attached_to?(instance_id)
  instance = find_ec2(instance_id)
  return false unless instance
  return false unless resource_via_client.attachments

  resource_via_client.attachments.first.instance_id == instance.instance_id && \
    resource_via_client.attachments.first.state == 'attached'
end
id() click to toggle source
# File lib/awspec/type/ebs.rb, line 17
def id
  @id ||= resource_via_client.volume_id if resource_via_client
end
resource_via_client() click to toggle source
# File lib/awspec/type/ebs.rb, line 13
def resource_via_client
  @resource_via_client ||= find_ebs(@display_name)
end