Class: AWSCDK::EC2::EbsDeviceProps
- Inherits:
-
EbsDeviceSnapshotOptions
- Object
- EbsDeviceSnapshotOptions
- AWSCDK::EC2::EbsDeviceProps
- Defined in:
- ec2/ebs_device_props.rb
Overview
Properties of an EBS block device.
Instance Attribute Summary collapse
-
#delete_on_termination ⇒ Boolean?
readonly
Indicates whether to delete the volume when the instance is terminated.
-
#encrypted ⇒ Boolean?
readonly
Specifies whether the EBS volume is encrypted.
-
#iops ⇒ Numeric?
readonly
The number of I/O operations per second (IOPS) to provision for the volume.
-
#kms_key ⇒ AWSCDK::KMS::IKey?
readonly
The ARN of the AWS Key Management Service (AWS KMS) CMK used for encryption.
-
#snapshot_id ⇒ String?
readonly
The snapshot ID of the volume to use.
-
#throughput ⇒ Numeric?
readonly
The throughput to provision for a
gp3volume. -
#volume_size ⇒ Numeric?
readonly
The volume size, in Gibibytes (GiB).
-
#volume_type ⇒ AWSCDK::EC2::EbsDeviceVolumeType?
readonly
The EBS volume type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(delete_on_termination: nil, iops: nil, throughput: nil, volume_type: nil, volume_size: nil, encrypted: nil, kms_key: nil, snapshot_id: nil) ⇒ EbsDeviceProps
constructor
A new instance of EbsDeviceProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(delete_on_termination: nil, iops: nil, throughput: nil, volume_type: nil, volume_size: nil, encrypted: nil, kms_key: nil, snapshot_id: nil) ⇒ EbsDeviceProps
Returns a new instance of EbsDeviceProps.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'ec2/ebs_device_props.rb', line 16 def initialize(delete_on_termination: nil, iops: nil, throughput: nil, volume_type: nil, volume_size: nil, encrypted: nil, kms_key: nil, snapshot_id: nil) @delete_on_termination = delete_on_termination Jsii::Type.check_type(@delete_on_termination, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "deleteOnTermination") unless @delete_on_termination.nil? @iops = iops Jsii::Type.check_type(@iops, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "iops") unless @iops.nil? @throughput = throughput Jsii::Type.check_type(@throughput, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "throughput") unless @throughput.nil? @volume_type = volume_type Jsii::Type.check_type(@volume_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkVic0RldmljZVZvbHVtZVR5cGUifQ==")), "volumeType") unless @volume_type.nil? @volume_size = volume_size Jsii::Type.check_type(@volume_size, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "volumeSize") unless @volume_size.nil? @encrypted = encrypted Jsii::Type.check_type(@encrypted, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "encrypted") unless @encrypted.nil? @kms_key = kms_key Jsii::Type.check_type(@kms_key, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfa21zLklLZXkifQ==")), "kmsKey") unless @kms_key.nil? @snapshot_id = snapshot_id Jsii::Type.check_type(@snapshot_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "snapshotId") unless @snapshot_id.nil? end |
Instance Attribute Details
#delete_on_termination ⇒ Boolean? (readonly)
Default: - true for Amazon EC2 Auto Scaling, false otherwise (e.g. EBS)
Indicates whether to delete the volume when the instance is terminated.
39 40 41 |
# File 'ec2/ebs_device_props.rb', line 39 def delete_on_termination @delete_on_termination end |
#encrypted ⇒ Boolean? (readonly)
Default: false
Specifies whether the EBS volume is encrypted.
Encrypted EBS volumes can only be attached to instances that support Amazon EBS encryption
82 83 84 |
# File 'ec2/ebs_device_props.rb', line 82 def encrypted @encrypted end |
#iops ⇒ Numeric? (readonly)
Default: - none, required for EbsDeviceVolumeType.IO1
The number of I/O operations per second (IOPS) to provision for the volume.
Must only be set for volume_type: EbsDeviceVolumeType.IO1
The maximum ratio of IOPS to volume size (in GiB) is 50:1, so for 5,000 provisioned IOPS, you need at least 100 GiB storage on the volume.
50 51 52 |
# File 'ec2/ebs_device_props.rb', line 50 def iops @iops end |
#kms_key ⇒ AWSCDK::KMS::IKey? (readonly)
Default: - If encrypted is true, the default aws/ebs KMS key will be used.
The ARN of the AWS Key Management Service (AWS KMS) CMK used for encryption.
You have to ensure that the KMS CMK has the correct permissions to be used by the service launching the ec2 instances.
90 91 92 |
# File 'ec2/ebs_device_props.rb', line 90 def kms_key @kms_key end |
#snapshot_id ⇒ String? (readonly)
Default: - No snapshot will be used
The snapshot ID of the volume to use.
95 96 97 |
# File 'ec2/ebs_device_props.rb', line 95 def snapshot_id @snapshot_id end |
#throughput ⇒ Numeric? (readonly)
Default: - 125 MiB/s.
The throughput to provision for a gp3 volume.
Valid Range: Minimum value of 125. Maximum value of 2000.
gp3 volumes deliver a consistent baseline throughput performance of 125 MiB/s.
You can provision additional throughput for an additional cost at a ratio of 0.25 MiB/s per provisioned IOPS.
61 62 63 |
# File 'ec2/ebs_device_props.rb', line 61 def throughput @throughput end |
#volume_size ⇒ Numeric? (readonly)
Default: - The snapshot size
The volume size, in Gibibytes (GiB).
If you specify volumeSize, it must be equal or greater than the size of the snapshot.
74 75 76 |
# File 'ec2/ebs_device_props.rb', line 74 def volume_size @volume_size end |
#volume_type ⇒ AWSCDK::EC2::EbsDeviceVolumeType? (readonly)
Default: EbsDeviceVolumeType.GENERAL_PURPOSE_SSD or EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3 if @aws-cdk/aws-ec2:ebsDefaultGp3Volume is enabled.
The EBS volume type.
67 68 69 |
# File 'ec2/ebs_device_props.rb', line 67 def volume_type @volume_type end |
Class Method Details
.jsii_properties ⇒ Object
97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'ec2/ebs_device_props.rb', line 97 def self.jsii_properties { :delete_on_termination => "deleteOnTermination", :iops => "iops", :throughput => "throughput", :volume_type => "volumeType", :volume_size => "volumeSize", :encrypted => "encrypted", :kms_key => "kmsKey", :snapshot_id => "snapshotId", } end |
Instance Method Details
#to_jsii ⇒ Object
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'ec2/ebs_device_props.rb', line 110 def to_jsii result = {} result.merge!(super) result.merge!({ "deleteOnTermination" => @delete_on_termination, "iops" => @iops, "throughput" => @throughput, "volumeType" => @volume_type, "volumeSize" => @volume_size, "encrypted" => @encrypted, "kmsKey" => @kms_key, "snapshotId" => @snapshot_id, }) result.compact end |