Class: AWSCDK::OpsWorks::CfnInstance::BlockDeviceMappingProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ops_works/cfn_instance.rb

Overview

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 that is exposed to the instance, such as /dev/sdh .

  • ebs (AWSCDK::IResolvable, AWSCDK::OpsWorks::CfnInstance::EbsBlockDeviceProperty, nil) (defaults to: nil)

    An EBSBlockDevice that defines how to configure an Amazon EBS volume when the instance is launched.

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

    Suppresses the specified device included in the AMI's block device mapping.

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

    The virtual device name.



806
807
808
809
810
811
812
813
814
815
# File 'ops_works/cfn_instance.rb', line 806

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::OpsWorks::CfnInstance::EbsBlockDeviceProperty.new(**ebs.transform_keys(&:to_sym)) : ebs
  Jsii::Type.check_type(@ebs, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19vcHN3b3Jrcy5DZm5JbnN0YW5jZS5FYnNCbG9ja0RldmljZVByb3BlcnR5In1dfX0=")), "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 that is exposed to the instance, such as /dev/sdh .

For the root device, you can use the explicit device name or you can set this parameter to ROOT_DEVICE and OpsWorks Stacks will provide the correct device name.



823
824
825
# File 'ops_works/cfn_instance.rb', line 823

def device_name
  @device_name
end

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

An EBSBlockDevice that defines how to configure an Amazon EBS volume when the instance is launched.

You can specify either the VirtualName or Ebs , but not both.



830
831
832
# File 'ops_works/cfn_instance.rb', line 830

def ebs
  @ebs
end

#no_deviceString? (readonly)

Suppresses the specified device included in the AMI's block device mapping.



835
836
837
# File 'ops_works/cfn_instance.rb', line 835

def no_device
  @no_device
end

#virtual_nameString? (readonly)

The virtual device name.

For more information, see BlockDeviceMapping . You can specify either the VirtualName or Ebs , but not both.



842
843
844
# File 'ops_works/cfn_instance.rb', line 842

def virtual_name
  @virtual_name
end

Class Method Details

.jsii_propertiesObject



844
845
846
847
848
849
850
851
# File 'ops_works/cfn_instance.rb', line 844

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

Instance Method Details

#to_jsiiObject



853
854
855
856
857
858
859
860
861
862
# File 'ops_works/cfn_instance.rb', line 853

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