Class: Serverspec::Type::AWS::EC2::Volume

Inherits:
Base
  • Object
show all
Defined in:
lib/resources/ec2/image.rb

Overview

The Volume class exposes the image root volume as Aws::EC2::Types::BlockDeviceMapping

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(vol, volume_type) ⇒ Volume

Returns a new instance of Volume



73
74
75
76
# File 'lib/resources/ec2/image.rb', line 73

def initialize(vol, volume_type)
  @volume = vol
  @type = volume_type
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type



90
91
92
# File 'lib/resources/ec2/image.rb', line 90

def type
  @type
end

Instance Method Details

#device_nameObject



86
87
88
# File 'lib/resources/ec2/image.rb', line 86

def device_name
  @volume.device_name
end

#encrypted?Boolean

Returns:

  • (Boolean)


78
79
80
# File 'lib/resources/ec2/image.rb', line 78

def encrypted?
  @volume.ebs.encrypted
end

#snapshot_idObject



82
83
84
# File 'lib/resources/ec2/image.rb', line 82

def snapshot_id
  @volume.ebs.snapshot_id
end

#to_sString

Returns the string representation of EC2::RootVolume

Returns:

  • (String)


94
95
96
# File 'lib/resources/ec2/image.rb', line 94

def to_s
  "EC2 Image Root Volume: #{@volume.ebs.snapshot_id}"
end