Class: AWSCDK::EC2::BlockDevice
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::EC2::BlockDevice
- Defined in:
- ec2/block_device.rb
Overview
Block device.
Instance Attribute Summary collapse
-
#device_name ⇒ String
readonly
The device name exposed to the EC2 instance.
-
#mapping_enabled ⇒ Boolean?
readonly
If false, the device mapping will be suppressed.
-
#volume ⇒ AWSCDK::EC2::BlockDeviceVolume
readonly
Defines the block device volume, to be either an Amazon EBS volume or an ephemeral instance store volume.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(device_name:, volume:, mapping_enabled: nil) ⇒ BlockDevice
constructor
A new instance of BlockDevice.
- #to_jsii ⇒ Object
Constructor Details
#initialize(device_name:, volume:, mapping_enabled: nil) ⇒ BlockDevice
Returns a new instance of BlockDevice.
10 11 12 13 14 15 16 17 |
# File 'ec2/block_device.rb', line 10 def initialize(device_name:, volume:, mapping_enabled: nil) @device_name = device_name Jsii::Type.check_type(@device_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "deviceName") @volume = volume Jsii::Type.check_type(@volume, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkJsb2NrRGV2aWNlVm9sdW1lIn0=")), "volume") @mapping_enabled = mapping_enabled Jsii::Type.check_type(@mapping_enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "mappingEnabled") unless @mapping_enabled.nil? end |
Instance Attribute Details
#device_name ⇒ String (readonly)
The device name exposed to the EC2 instance.
For example, a value like /dev/sdh, xvdh.
25 26 27 |
# File 'ec2/block_device.rb', line 25 def device_name @device_name end |
#mapping_enabled ⇒ Boolean? (readonly)
Default: true - device mapping is left untouched
If false, the device mapping will be suppressed.
If set to false for the root device, the instance might fail the Amazon EC2 health check. Amazon EC2 Auto Scaling launches a replacement instance if the instance fails the health check.
39 40 41 |
# File 'ec2/block_device.rb', line 39 def mapping_enabled @mapping_enabled end |
#volume ⇒ AWSCDK::EC2::BlockDeviceVolume (readonly)
Defines the block device volume, to be either an Amazon EBS volume or an ephemeral instance store volume.
For example, a value like BlockDeviceVolume.ebs(15), BlockDeviceVolume.ephemeral(0).
31 32 33 |
# File 'ec2/block_device.rb', line 31 def volume @volume end |
Class Method Details
.jsii_properties ⇒ Object
41 42 43 44 45 46 47 |
# File 'ec2/block_device.rb', line 41 def self.jsii_properties { :device_name => "deviceName", :volume => "volume", :mapping_enabled => "mappingEnabled", } end |
Instance Method Details
#to_jsii ⇒ Object
49 50 51 52 53 54 55 56 57 |
# File 'ec2/block_device.rb', line 49 def to_jsii result = {} result.merge!({ "deviceName" => @device_name, "volume" => @volume, "mappingEnabled" => @mapping_enabled, }) result.compact end |