Class: AWSCDK::EC2::CfnVolumeAttachmentProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::EC2::CfnVolumeAttachmentProps
- Defined in:
- ec2/cfn_volume_attachment_props.rb
Overview
Properties for defining a CfnVolumeAttachment.
Instance Attribute Summary collapse
-
#device ⇒ String?
readonly
The device name (for example,
/dev/sdhorxvdh). -
#ebs_card_index ⇒ Numeric?
readonly
The index of the EBS card.
-
#instance_id ⇒ String, AWSCDK::Interfaces::AWSEC2::IInstanceRef
readonly
The ID of the instance to which the volume attaches.
-
#volume_id ⇒ String, AWSCDK::Interfaces::AWSEC2::IVolumeRef
readonly
The ID of the Amazon EBS volume.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(instance_id:, volume_id:, device: nil, ebs_card_index: nil) ⇒ CfnVolumeAttachmentProps
constructor
A new instance of CfnVolumeAttachmentProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(instance_id:, volume_id:, device: nil, ebs_card_index: nil) ⇒ CfnVolumeAttachmentProps
Returns a new instance of CfnVolumeAttachmentProps.
13 14 15 16 17 18 19 20 21 22 |
# File 'ec2/cfn_volume_attachment_props.rb', line 13 def initialize(instance_id:, volume_id:, device: nil, ebs_card_index: nil) @instance_id = instance_id Jsii::Type.check_type(@instance_id, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19lYzIuSUluc3RhbmNlUmVmIn1dfX0=")), "instanceId") @volume_id = volume_id Jsii::Type.check_type(@volume_id, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19lYzIuSVZvbHVtZVJlZiJ9XX19")), "volumeId") @device = device Jsii::Type.check_type(@device, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "device") unless @device.nil? @ebs_card_index = ebs_card_index Jsii::Type.check_type(@ebs_card_index, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "ebsCardIndex") unless @ebs_card_index.nil? end |
Instance Attribute Details
#device ⇒ String? (readonly)
The device name (for example, /dev/sdh or xvdh ).
42 43 44 |
# File 'ec2/cfn_volume_attachment_props.rb', line 42 def device @device end |
#ebs_card_index ⇒ Numeric? (readonly)
The index of the EBS card.
Some instance types support multiple EBS cards. The default EBS card index is 0.
49 50 51 |
# File 'ec2/cfn_volume_attachment_props.rb', line 49 def ebs_card_index @ebs_card_index end |
#instance_id ⇒ String, AWSCDK::Interfaces::AWSEC2::IInstanceRef (readonly)
The ID of the instance to which the volume attaches.
This value can be a reference to an AWS::EC2::Instance resource, or it can be the physical ID of an existing EC2 instance.
30 31 32 |
# File 'ec2/cfn_volume_attachment_props.rb', line 30 def instance_id @instance_id end |
#volume_id ⇒ String, AWSCDK::Interfaces::AWSEC2::IVolumeRef (readonly)
The ID of the Amazon EBS volume.
The volume and instance must be within the same Availability Zone. This value can be a reference to an AWS::EC2::Volume resource, or it can be the volume ID of an existing Amazon EBS volume.
37 38 39 |
# File 'ec2/cfn_volume_attachment_props.rb', line 37 def volume_id @volume_id end |
Class Method Details
.jsii_properties ⇒ Object
51 52 53 54 55 56 57 58 |
# File 'ec2/cfn_volume_attachment_props.rb', line 51 def self.jsii_properties { :instance_id => "instanceId", :volume_id => "volumeId", :device => "device", :ebs_card_index => "ebsCardIndex", } end |
Instance Method Details
#to_jsii ⇒ Object
60 61 62 63 64 65 66 67 68 69 |
# File 'ec2/cfn_volume_attachment_props.rb', line 60 def to_jsii result = {} result.merge!({ "instanceId" => @instance_id, "volumeId" => @volume_id, "device" => @device, "ebsCardIndex" => @ebs_card_index, }) result.compact end |