Class: AWSCDK::EC2::EbsDeviceOptionsBase

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

Overview

Base block device options for an EBS volume.

Direct Known Subclasses

EbsDeviceOptions, EbsDeviceSnapshotOptions

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(delete_on_termination: nil, iops: nil, throughput: nil, volume_type: nil) ⇒ EbsDeviceOptionsBase

Returns a new instance of EbsDeviceOptionsBase.

Parameters:

  • delete_on_termination (Boolean, nil) (defaults to: nil)

    Indicates whether to delete the volume when the instance is terminated.

  • iops (Numeric, nil) (defaults to: nil)

    The number of I/O operations per second (IOPS) to provision for the volume.

  • throughput (Numeric, nil) (defaults to: nil)

    The throughput to provision for a gp3 volume.

  • volume_type (AWSCDK::EC2::EbsDeviceVolumeType, nil) (defaults to: nil)

    The EBS volume type.



11
12
13
14
15
16
17
18
19
20
# File 'ec2/ebs_device_options_base.rb', line 11

def initialize(delete_on_termination: nil, iops: nil, throughput: nil, volume_type: 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?
end

Instance Attribute Details

#delete_on_terminationBoolean? (readonly)

Note:

Default: - true for Amazon EC2 Auto Scaling, false otherwise (e.g. EBS)

Indicates whether to delete the volume when the instance is terminated.

Returns:

  • (Boolean, nil)


26
27
28
# File 'ec2/ebs_device_options_base.rb', line 26

def delete_on_termination
  @delete_on_termination
end

#iopsNumeric? (readonly)

Note:

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.



37
38
39
# File 'ec2/ebs_device_options_base.rb', line 37

def iops
  @iops
end

#throughputNumeric? (readonly)

Note:

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.



48
49
50
# File 'ec2/ebs_device_options_base.rb', line 48

def throughput
  @throughput
end

#volume_typeAWSCDK::EC2::EbsDeviceVolumeType? (readonly)

Note:

Default: EbsDeviceVolumeType.GENERAL_PURPOSE_SSD or EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3 if @aws-cdk/aws-ec2:ebsDefaultGp3Volume is enabled.

The EBS volume type.



54
55
56
# File 'ec2/ebs_device_options_base.rb', line 54

def volume_type
  @volume_type
end

Class Method Details

.jsii_propertiesObject



56
57
58
59
60
61
62
63
# File 'ec2/ebs_device_options_base.rb', line 56

def self.jsii_properties
  {
    :delete_on_termination => "deleteOnTermination",
    :iops => "iops",
    :throughput => "throughput",
    :volume_type => "volumeType",
  }
end

Instance Method Details

#to_jsiiObject



65
66
67
68
69
70
71
72
73
74
# File 'ec2/ebs_device_options_base.rb', line 65

def to_jsii
  result = {}
  result.merge!({
    "deleteOnTermination" => @delete_on_termination,
    "iops" => @iops,
    "throughput" => @throughput,
    "volumeType" => @volume_type,
  })
  result.compact
end