Class: AWSCDK::Autoscaling::CfnLaunchConfiguration::BlockDeviceProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
autoscaling/cfn_launch_configuration.rb

Overview

BlockDevice is a property of the EBS property of the AWS::AutoScaling::LaunchConfiguration BlockDeviceMapping property type that describes an Amazon EBS volume.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(delete_on_termination: nil, encrypted: nil, iops: nil, snapshot_id: nil, throughput: nil, volume_size: nil, volume_type: nil) ⇒ BlockDeviceProperty

Returns a new instance of BlockDeviceProperty.

Parameters:

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

    Indicates whether the volume is deleted on instance termination.

  • encrypted (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Specifies whether the volume should be encrypted.

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

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

  • snapshot_id (String, nil) (defaults to: nil)

    The snapshot ID of the volume to use.

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

    The throughput (MiBps) to provision for a gp3 volume.

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

    The volume size, in GiBs. The following are the supported volumes sizes for each volume type:.

  • volume_type (String, nil) (defaults to: nil)

    The volume type. For more information, see Amazon EBS volume types in the Amazon EBS User Guide .



814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
# File 'autoscaling/cfn_launch_configuration.rb', line 814

def initialize(delete_on_termination: nil, encrypted: nil, iops: nil, snapshot_id: nil, throughput: nil, volume_size: nil, volume_type: nil)
  @delete_on_termination = delete_on_termination
  Jsii::Type.check_type(@delete_on_termination, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "deleteOnTermination") unless @delete_on_termination.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?
  @snapshot_id = snapshot_id
  Jsii::Type.check_type(@snapshot_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "snapshotId") unless @snapshot_id.nil?
  @throughput = throughput
  Jsii::Type.check_type(@throughput, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "throughput") unless @throughput.nil?
  @volume_size = volume_size
  Jsii::Type.check_type(@volume_size, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "volumeSize") unless @volume_size.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

#delete_on_terminationBoolean, ... (readonly)

Indicates whether the volume is deleted on instance termination.

For Amazon EC2 Auto Scaling, the default value is true .



837
838
839
# File 'autoscaling/cfn_launch_configuration.rb', line 837

def delete_on_termination
  @delete_on_termination
end

#encryptedBoolean, ... (readonly)

Specifies whether the volume should be encrypted.

Encrypted EBS volumes can only be attached to instances that support Amazon EBS encryption. For more information, see Requirements for Amazon EBS encryption in the Amazon EBS User Guide . If your AMI uses encrypted volumes, you can also only launch it on supported instance types.

If you are creating a volume from a snapshot, you cannot create an unencrypted volume from an encrypted snapshot. Also, you cannot specify a KMS key ID when using a launch configuration.

If you enable encryption by default, the EBS volumes that you create are always encrypted, either using the AWS managed KMS key or a customer-managed KMS key, regardless of whether the snapshot was encrypted.

For more information, see Use AWS KMS keys to encrypt Amazon EBS volumes in the Amazon EC2 Auto Scaling User Guide .



850
851
852
# File 'autoscaling/cfn_launch_configuration.rb', line 850

def encrypted
  @encrypted
end

#iopsNumeric? (readonly)

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

For gp3 and io1 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.

The following are the supported values for each volume type:

  • gp3 : 3,000-16,000 IOPS
  • io1 : 100-64,000 IOPS

For io1 volumes, we guarantee 64,000 IOPS only for Instances built on the Nitro System . Other instance families guarantee performance up to 32,000 IOPS.

Iops is supported when the volume type is gp3 or io1 and required only when the volume type is io1 . (Not used with standard , gp2 , st1 , or sc1 volumes.)



866
867
868
# File 'autoscaling/cfn_launch_configuration.rb', line 866

def iops
  @iops
end

#snapshot_idString? (readonly)

The snapshot ID of the volume to use.

You must specify either a VolumeSize or a SnapshotId .



873
874
875
# File 'autoscaling/cfn_launch_configuration.rb', line 873

def snapshot_id
  @snapshot_id
end

#throughputNumeric? (readonly)

The throughput (MiBps) to provision for a gp3 volume.



878
879
880
# File 'autoscaling/cfn_launch_configuration.rb', line 878

def throughput
  @throughput
end

#volume_sizeNumeric? (readonly)

The volume size, in GiBs. The following are the supported volumes sizes for each volume type:.

  • gp2 and gp3 : 1-16,384
  • io1 : 4-16,384
  • st1 and sc1 : 125-16,384
  • standard : 1-1,024

You must specify either a SnapshotId or a VolumeSize . If you specify both SnapshotId and VolumeSize , the volume size must be equal or greater than the size of the snapshot.



890
891
892
# File 'autoscaling/cfn_launch_configuration.rb', line 890

def volume_size
  @volume_size
end

#volume_typeString? (readonly)

The volume type. For more information, see Amazon EBS volume types in the Amazon EBS User Guide .

Valid values: standard | io1 | gp2 | st1 | sc1 | gp3



897
898
899
# File 'autoscaling/cfn_launch_configuration.rb', line 897

def volume_type
  @volume_type
end

Class Method Details

.jsii_propertiesObject



899
900
901
902
903
904
905
906
907
908
909
# File 'autoscaling/cfn_launch_configuration.rb', line 899

def self.jsii_properties
  {
    :delete_on_termination => "deleteOnTermination",
    :encrypted => "encrypted",
    :iops => "iops",
    :snapshot_id => "snapshotId",
    :throughput => "throughput",
    :volume_size => "volumeSize",
    :volume_type => "volumeType",
  }
end

Instance Method Details

#to_jsiiObject



911
912
913
914
915
916
917
918
919
920
921
922
923
# File 'autoscaling/cfn_launch_configuration.rb', line 911

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