Class: AWSCDK::EC2::CfnInstance::VolumeProperty

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

Overview

Specifies a volume to attach to an instance.

Volume is an embedded property of the AWS::EC2::Instance resource.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(device:, volume_id:) ⇒ VolumeProperty

Returns a new instance of VolumeProperty.

Parameters:

  • device (String)

    The device name (for example, /dev/sdh or xvdh ).

  • volume_id (String)

    The ID of the EBS volume.



2402
2403
2404
2405
2406
2407
# File 'ec2/cfn_instance.rb', line 2402

def initialize(device:, volume_id:)
  @device = device
  Jsii::Type.check_type(@device, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "device")
  @volume_id = volume_id
  Jsii::Type.check_type(@volume_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "volumeId")
end

Instance Attribute Details

#deviceString (readonly)

The device name (for example, /dev/sdh or xvdh ).



2413
2414
2415
# File 'ec2/cfn_instance.rb', line 2413

def device
  @device
end

#volume_idString (readonly)

The ID of the EBS volume.

The volume and instance must be within the same Availability Zone.



2420
2421
2422
# File 'ec2/cfn_instance.rb', line 2420

def volume_id
  @volume_id
end

Class Method Details

.jsii_propertiesObject



2422
2423
2424
2425
2426
2427
# File 'ec2/cfn_instance.rb', line 2422

def self.jsii_properties
  {
    :device => "device",
    :volume_id => "volumeId",
  }
end

Instance Method Details

#to_jsiiObject



2429
2430
2431
2432
2433
2434
2435
2436
# File 'ec2/cfn_instance.rb', line 2429

def to_jsii
  result = {}
  result.merge!({
    "device" => @device,
    "volumeId" => @volume_id,
  })
  result.compact
end