Class: AWSCDK::EC2::CfnEC2Fleet::BlockDeviceMappingProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ec2/cfn_ec2_fleet.rb

Overview

Describes a block device mapping, which defines the EBS volumes and instance store volumes to attach to an instance at launch.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(device_name: nil, ebs: nil, no_device: nil, virtual_name: nil) ⇒ BlockDeviceMappingProperty

Returns a new instance of BlockDeviceMappingProperty.

Parameters:

  • device_name (String, nil) (defaults to: nil)

    The device name.

  • ebs (AWSCDK::IResolvable, AWSCDK::EC2::CfnEC2Fleet::EbsBlockDeviceProperty, nil) (defaults to: nil)

    Parameters used to automatically set up EBS volumes when the instance is launched.

  • no_device (String, nil) (defaults to: nil)

    To omit the device from the block device mapping, specify an empty string.

  • virtual_name (String, nil) (defaults to: nil)

    The virtual device name ( ephemeral N).



869
870
871
872
873
874
875
876
877
878
# File 'ec2/cfn_ec2_fleet.rb', line 869

def initialize(device_name: nil, ebs: nil, no_device: nil, virtual_name: nil)
  @device_name = device_name
  Jsii::Type.check_type(@device_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "deviceName") unless @device_name.nil?
  @ebs = ebs.is_a?(Hash) ? ::AWSCDK::EC2::CfnEC2Fleet::EbsBlockDeviceProperty.new(**ebs.transform_keys(&:to_sym)) : ebs
  Jsii::Type.check_type(@ebs, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuRUMyRmxlZXQuRWJzQmxvY2tEZXZpY2VQcm9wZXJ0eSJ9XX19")), "ebs") unless @ebs.nil?
  @no_device = no_device
  Jsii::Type.check_type(@no_device, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "noDevice") unless @no_device.nil?
  @virtual_name = virtual_name
  Jsii::Type.check_type(@virtual_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "virtualName") unless @virtual_name.nil?
end

Instance Attribute Details

#device_nameString? (readonly)

The device name.

For available device names, see Device names for volumes .



886
887
888
# File 'ec2/cfn_ec2_fleet.rb', line 886

def device_name
  @device_name
end

#ebsAWSCDK::IResolvable, ... (readonly)

Parameters used to automatically set up EBS volumes when the instance is launched.



891
892
893
# File 'ec2/cfn_ec2_fleet.rb', line 891

def ebs
  @ebs
end

#no_deviceString? (readonly)

To omit the device from the block device mapping, specify an empty string.

When this property is specified, the device is removed from the block device mapping regardless of the assigned value.



898
899
900
# File 'ec2/cfn_ec2_fleet.rb', line 898

def no_device
  @no_device
end

#virtual_nameString? (readonly)

The virtual device name ( ephemeral N).

Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 . The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.

NVMe instance store volumes are automatically enumerated and assigned a device name. Including them in your block device mapping has no effect.

Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.



909
910
911
# File 'ec2/cfn_ec2_fleet.rb', line 909

def virtual_name
  @virtual_name
end

Class Method Details

.jsii_propertiesObject



911
912
913
914
915
916
917
918
# File 'ec2/cfn_ec2_fleet.rb', line 911

def self.jsii_properties
  {
    :device_name => "deviceName",
    :ebs => "ebs",
    :no_device => "noDevice",
    :virtual_name => "virtualName",
  }
end

Instance Method Details

#to_jsiiObject



920
921
922
923
924
925
926
927
928
929
# File 'ec2/cfn_ec2_fleet.rb', line 920

def to_jsii
  result = {}
  result.merge!({
    "deviceName" => @device_name,
    "ebs" => @ebs,
    "noDevice" => @no_device,
    "virtualName" => @virtual_name,
  })
  result.compact
end