Class: AWSCDK::EC2::CfnVolumeProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::EC2::CfnVolumeProps
- Defined in:
- ec2/cfn_volume_props.rb
Overview
Properties for defining a CfnVolume.
Instance Attribute Summary collapse
-
#auto_enable_io ⇒ Boolean, ...
readonly
Indicates whether the volume is auto-enabled for I/O operations.
-
#availability_zone ⇒ String?
readonly
The ID of the Availability Zone in which to create the volume.
-
#availability_zone_id ⇒ String?
readonly
The ID of the Availability Zone in which to create the volume.
-
#encrypted ⇒ Boolean, ...
readonly
Indicates whether the volume should be encrypted.
-
#iops ⇒ Numeric?
readonly
The number of I/O operations per second (IOPS) to provision for the volume.
-
#kms_key_id ⇒ String?
readonly
The identifier of the AWS KMS key to use for Amazon EBS encryption.
-
#multi_attach_enabled ⇒ Boolean, ...
readonly
Indicates whether Amazon EBS Multi-Attach is enabled.
-
#outpost_arn ⇒ String?
readonly
The Amazon Resource Name (ARN) of the Outpost on which to create the volume.
-
#size ⇒ Numeric?
readonly
The size of the volume, in GiBs.
-
#snapshot_id ⇒ String?
readonly
The snapshot from which to create the volume.
-
#source_volume_id ⇒ String?
readonly
The ID of the source EBS volume to copy.
-
#tags ⇒ Array<AWSCDK::CfnTag>?
readonly
The tags to apply to the volume during creation.
-
#throughput ⇒ Numeric?
readonly
The throughput to provision for a volume, with a maximum of 1,000 MiB/s.
-
#volume_initialization_rate ⇒ Numeric?
readonly
Specifies the Amazon EBS Provisioned Rate for Volume Initialization (volume initialization rate), in MiB/s, at which to download the snapshot blocks from Amazon S3 to the volume.
-
#volume_type ⇒ String?
readonly
The volume type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(auto_enable_io: nil, availability_zone: nil, availability_zone_id: nil, encrypted: nil, iops: nil, kms_key_id: nil, multi_attach_enabled: nil, outpost_arn: nil, size: nil, snapshot_id: nil, source_volume_id: nil, tags: nil, throughput: nil, volume_initialization_rate: nil, volume_type: nil) ⇒ CfnVolumeProps
constructor
A new instance of CfnVolumeProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(auto_enable_io: nil, availability_zone: nil, availability_zone_id: nil, encrypted: nil, iops: nil, kms_key_id: nil, multi_attach_enabled: nil, outpost_arn: nil, size: nil, snapshot_id: nil, source_volume_id: nil, tags: nil, throughput: nil, volume_initialization_rate: nil, volume_type: nil) ⇒ CfnVolumeProps
Returns a new instance of CfnVolumeProps.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'ec2/cfn_volume_props.rb', line 24 def initialize(auto_enable_io: nil, availability_zone: nil, availability_zone_id: nil, encrypted: nil, iops: nil, kms_key_id: nil, multi_attach_enabled: nil, outpost_arn: nil, size: nil, snapshot_id: nil, source_volume_id: nil, tags: nil, throughput: nil, volume_initialization_rate: nil, volume_type: nil) @auto_enable_io = auto_enable_io Jsii::Type.check_type(@auto_enable_io, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "autoEnableIo") unless @auto_enable_io.nil? @availability_zone = availability_zone Jsii::Type.check_type(@availability_zone, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "availabilityZone") unless @availability_zone.nil? @availability_zone_id = availability_zone_id Jsii::Type.check_type(@availability_zone_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "availabilityZoneId") unless @availability_zone_id.nil? @encrypted = encrypted Jsii::Type.check_type(@encrypted, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "encrypted") unless @encrypted.nil? @iops = iops Jsii::Type.check_type(@iops, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "iops") unless @iops.nil? @kms_key_id = kms_key_id Jsii::Type.check_type(@kms_key_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "kmsKeyId") unless @kms_key_id.nil? @multi_attach_enabled = multi_attach_enabled Jsii::Type.check_type(@multi_attach_enabled, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "multiAttachEnabled") unless @multi_attach_enabled.nil? @outpost_arn = outpost_arn Jsii::Type.check_type(@outpost_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "outpostArn") unless @outpost_arn.nil? @size = size Jsii::Type.check_type(@size, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "size") unless @size.nil? @snapshot_id = snapshot_id Jsii::Type.check_type(@snapshot_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "snapshotId") unless @snapshot_id.nil? @source_volume_id = source_volume_id Jsii::Type.check_type(@source_volume_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "sourceVolumeId") unless @source_volume_id.nil? @tags = .is_a?(Array) ? .map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil? @throughput = throughput Jsii::Type.check_type(@throughput, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "throughput") unless @throughput.nil? @volume_initialization_rate = volume_initialization_rate Jsii::Type.check_type(@volume_initialization_rate, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "volumeInitializationRate") unless @volume_initialization_rate.nil? @volume_type = volume_type Jsii::Type.check_type(@volume_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "volumeType") unless @volume_type.nil? end |
Instance Attribute Details
#auto_enable_io ⇒ Boolean, ... (readonly)
Indicates whether the volume is auto-enabled for I/O operations.
By default, Amazon EBS disables I/O to the volume from attached EC2 instances when it determines that a volume's data is potentially inconsistent. If the consistency of the volume is not a concern, and you prefer that the volume be made available immediately if it's impaired, you can configure the volume to automatically enable I/O.
63 64 65 |
# File 'ec2/cfn_volume_props.rb', line 63 def auto_enable_io @auto_enable_io end |
#availability_zone ⇒ String? (readonly)
The ID of the Availability Zone in which to create the volume. For example, us-east-1a .
Either AvailabilityZone or AvailabilityZoneId must be specified, but not both.
If you are creating a volume copy, omit this parameter. The volume copy is created in the same Availability Zone as the source volume.
72 73 74 |
# File 'ec2/cfn_volume_props.rb', line 72 def availability_zone @availability_zone end |
#availability_zone_id ⇒ String? (readonly)
The ID of the Availability Zone in which to create the volume. For example, use1-az1 .
Either AvailabilityZone or AvailabilityZoneId must be specified, but not both.
If you are creating a volume copy, omit this parameter. The volume copy is created in the same Availability Zone as the source volume.
81 82 83 |
# File 'ec2/cfn_volume_props.rb', line 81 def availability_zone_id @availability_zone_id end |
#encrypted ⇒ Boolean, ... (readonly)
Indicates whether the volume should be encrypted.
The effect of setting the encryption state to true depends on the volume origin (new, from a snapshot, or from an existing volume), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Encryption by default in the Amazon EBS User Guide .
If you are creating a volume copy, omit this parameter. The volume is automatically encrypted with the same KMS key as the source volume. You can't copy unencrypted volumes.
90 91 92 |
# File 'ec2/cfn_volume_props.rb', line 90 def encrypted @encrypted end |
#iops ⇒ Numeric? (readonly)
The number of I/O operations per second (IOPS) to provision for the volume.
Required for io1 and io2 volumes. Optional for gp3 volumes. Omit for all other volume types.
Valid ranges:
- gp3:
3,000( default )- 80,000IOPS - io1:
100 - 64,000IOPS - io2:
100 - 256,000IOPS
Instances built on the Nitro System can support up to 256,000 IOPS. Other instances can support up to 32,000 IOPS.
105 106 107 |
# File 'ec2/cfn_volume_props.rb', line 105 def iops @iops end |
#kms_key_id ⇒ String? (readonly)
The identifier of the AWS KMS key to use for Amazon EBS encryption.
If KmsKeyId is specified, the encrypted state must be true .
If you omit this property and your account is enabled for encryption by default, or Encrypted is set to true , then the volume is encrypted using the default key specified for your account. If your account does not have a default key, then the volume is encrypted using the AWS managed key .
Alternatively, if you want to specify a different key, you can specify one of the following:
- Key ID. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.
- Key alias. Specify the alias for the key, prefixed with
alias/. For example, for a key with the aliasmy_cmk, usealias/my_cmk. Or to specify the AWS managed key , usealias/aws/ebs. - Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/1234abcd-12ab-34cd-56ef-1234567890ab.
- Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.
If you are creating a volume copy, omit this parameter. The volume is automatically encrypted with the same KMS key as the source volume. You can't copy unencrypted volumes.
123 124 125 |
# File 'ec2/cfn_volume_props.rb', line 123 def kms_key_id @kms_key_id end |
#multi_attach_enabled ⇒ Boolean, ... (readonly)
Indicates whether Amazon EBS Multi-Attach is enabled.
AWS CloudFormation does not currently support updating a single-attach volume to be multi-attach enabled, updating a multi-attach enabled volume to be single-attach, or updating the size or number of I/O operations per second (IOPS) of a multi-attach enabled volume.
130 131 132 |
# File 'ec2/cfn_volume_props.rb', line 130 def multi_attach_enabled @multi_attach_enabled end |
#outpost_arn ⇒ String? (readonly)
The Amazon Resource Name (ARN) of the Outpost on which to create the volume.
If you intend to use a volume with an instance running on an outpost, then you must create the volume on the same outpost as the instance. You can't use a volume created in an AWS Region with an instance on an AWS outpost, or the other way around.
137 138 139 |
# File 'ec2/cfn_volume_props.rb', line 137 def outpost_arn @outpost_arn end |
#size ⇒ Numeric? (readonly)
The size of the volume, in GiBs.
- Required for new empty volumes.
- Optional for volumes created from snapshots and volume copies. In this case, the size defaults to the size of the snapshot or source volume. You can optionally specify a size that is equal to or larger than the size of the source snapshot or volume.
Supported volume sizes:
- gp2:
1 - 16,384GiB - gp3:
1 - 65,536GiB - io1:
4 - 16,384GiB - io2:
4 - 65,536GiB - st1 and sc1:
125 - 16,384GiB - standard:
1 - 1024GiB
154 155 156 |
# File 'ec2/cfn_volume_props.rb', line 154 def size @size end |
#snapshot_id ⇒ String? (readonly)
The snapshot from which to create the volume.
Only specify to create a volume from a snapshot. To create a new empty volume, omit this parameter and specify a value for Size instead. To create a volume copy, omit this parameter and specify SourceVolumeId instead.
161 162 163 |
# File 'ec2/cfn_volume_props.rb', line 161 def snapshot_id @snapshot_id end |
#source_volume_id ⇒ String? (readonly)
The ID of the source EBS volume to copy.
When specified, the volume is created as an exact copy of the specified volume. Only specify to create a volume copy. To create a new empty volume or to create a volume from a snapshot, omit this parameter,
168 169 170 |
# File 'ec2/cfn_volume_props.rb', line 168 def source_volume_id @source_volume_id end |
#tags ⇒ Array<AWSCDK::CfnTag>? (readonly)
The tags to apply to the volume during creation.
173 174 175 |
# File 'ec2/cfn_volume_props.rb', line 173 def @tags end |
#throughput ⇒ Numeric? (readonly)
The throughput to provision for a volume, with a maximum of 1,000 MiB/s.
This parameter is valid only for gp3 volumes. The default value is 125.
Valid Range: Minimum value of 125. Maximum value of 1000.
182 183 184 |
# File 'ec2/cfn_volume_props.rb', line 182 def throughput @throughput end |
#volume_initialization_rate ⇒ Numeric? (readonly)
Specifies the Amazon EBS Provisioned Rate for Volume Initialization (volume initialization rate), in MiB/s, at which to download the snapshot blocks from Amazon S3 to the volume.
This is also known as volume initialization . Specifying a volume initialization rate ensures that the volume is initialized at a predictable and consistent rate after creation.
This parameter is supported only for volumes created from snapshots. Omit this parameter if:
- You want to create the volume using fast snapshot restore. You must specify a snapshot that is enabled for fast snapshot restore. In this case, the volume is fully initialized at creation.
If you specify a snapshot that is enabled for fast snapshot restore and a volume initialization rate, the volume will be initialized at the specified rate instead of fast snapshot restore.
- You want to create a volume that is initialized at the default rate.
For more information, see Initialize Amazon EBS volumes in the Amazon EC2 User Guide .
Valid range: 100 - 300 MiB/s
201 202 203 |
# File 'ec2/cfn_volume_props.rb', line 201 def volume_initialization_rate @volume_initialization_rate end |
#volume_type ⇒ String? (readonly)
The volume type. This parameter can be one of the following values:.
- General Purpose SSD:
gp2|gp3 - Provisioned IOPS SSD:
io1|io2 - Throughput Optimized HDD:
st1 - Cold HDD:
sc1 - Magnetic:
standard
Throughput Optimized HDD (
st1) and Cold HDD (sc1) volumes can't be used as boot volumes.
For more information, see Amazon EBS volume types in the Amazon EBS User Guide .
Default: gp2
218 219 220 |
# File 'ec2/cfn_volume_props.rb', line 218 def volume_type @volume_type end |
Class Method Details
.jsii_properties ⇒ Object
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
# File 'ec2/cfn_volume_props.rb', line 220 def self.jsii_properties { :auto_enable_io => "autoEnableIo", :availability_zone => "availabilityZone", :availability_zone_id => "availabilityZoneId", :encrypted => "encrypted", :iops => "iops", :kms_key_id => "kmsKeyId", :multi_attach_enabled => "multiAttachEnabled", :outpost_arn => "outpostArn", :size => "size", :snapshot_id => "snapshotId", :source_volume_id => "sourceVolumeId", :tags => "tags", :throughput => "throughput", :volume_initialization_rate => "volumeInitializationRate", :volume_type => "volumeType", } end |
Instance Method Details
#to_jsii ⇒ Object
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 |
# File 'ec2/cfn_volume_props.rb', line 240 def to_jsii result = {} result.merge!({ "autoEnableIo" => @auto_enable_io, "availabilityZone" => @availability_zone, "availabilityZoneId" => @availability_zone_id, "encrypted" => @encrypted, "iops" => @iops, "kmsKeyId" => @kms_key_id, "multiAttachEnabled" => @multi_attach_enabled, "outpostArn" => @outpost_arn, "size" => @size, "snapshotId" => @snapshot_id, "sourceVolumeId" => @source_volume_id, "tags" => @tags, "throughput" => @throughput, "volumeInitializationRate" => @volume_initialization_rate, "volumeType" => @volume_type, }) result.compact end |