Class BlockDeviceVolume

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.autoscaling.BlockDeviceVolume
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-18T17:54:12.928Z") @Stability(Stable) public class BlockDeviceVolume extends software.amazon.jsii.JsiiObject
Describes a block device mapping for an EC2 instance or Auto Scaling group.

Example:

 Vpc vpc;
 InstanceType instanceType;
 IMachineImage machineImage;
 AutoScalingGroup autoScalingGroup = AutoScalingGroup.Builder.create(this, "ASG")
         .vpc(vpc)
         .instanceType(instanceType)
         .machineImage(machineImage)
         .blockDevices(List.of(BlockDevice.builder()
                 .deviceName("gp3-volume")
                 .volume(BlockDeviceVolume.ebs(15, EbsDeviceOptions.builder()
                         .volumeType(EbsDeviceVolumeType.GP3)
                         .throughput(125)
                         .build()))
                 .build()))
         .build();
 
  • Constructor Details

    • BlockDeviceVolume

      protected BlockDeviceVolume(software.amazon.jsii.JsiiObjectRef objRef)
    • BlockDeviceVolume

      protected BlockDeviceVolume(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • BlockDeviceVolume

      @Stability(Stable) protected BlockDeviceVolume(@Nullable EbsDeviceProps ebsDevice, @Nullable String virtualName)
      Parameters:
      ebsDevice - EBS device info.
      virtualName - Virtual device name.
    • BlockDeviceVolume

      @Stability(Stable) protected BlockDeviceVolume(@Nullable EbsDeviceProps ebsDevice)
      Parameters:
      ebsDevice - EBS device info.
    • BlockDeviceVolume

      @Stability(Stable) protected BlockDeviceVolume()
  • Method Details

    • ebs

      @Stability(Stable) @NotNull public static BlockDeviceVolume ebs(@NotNull Number volumeSize, @Nullable EbsDeviceOptions options)
      Creates a new Elastic Block Storage device.

      Parameters:
      volumeSize - The volume size, in Gibibytes (GiB). This parameter is required.
      options - additional device options.
    • ebs

      @Stability(Stable) @NotNull public static BlockDeviceVolume ebs(@NotNull Number volumeSize)
      Creates a new Elastic Block Storage device.

      Parameters:
      volumeSize - The volume size, in Gibibytes (GiB). This parameter is required.
    • ebsFromSnapshot

      @Stability(Stable) @NotNull public static BlockDeviceVolume ebsFromSnapshot(@NotNull String snapshotId, @Nullable EbsDeviceSnapshotOptions options)
      Creates a new Elastic Block Storage device from an existing snapshot.

      Parameters:
      snapshotId - The snapshot ID of the volume to use. This parameter is required.
      options - additional device options.
    • ebsFromSnapshot

      @Stability(Stable) @NotNull public static BlockDeviceVolume ebsFromSnapshot(@NotNull String snapshotId)
      Creates a new Elastic Block Storage device from an existing snapshot.

      Parameters:
      snapshotId - The snapshot ID of the volume to use. This parameter is required.
    • ephemeral

      @Stability(Stable) @NotNull public static BlockDeviceVolume ephemeral(@NotNull Number volumeIndex)
      Creates a virtual, ephemeral device.

      The name will be in the form ephemeral{volumeIndex}.

      Parameters:
      volumeIndex - the volume index. This parameter is required.
    • noDevice

      @Stability(Stable) @NotNull public static BlockDeviceVolume noDevice()
      Supresses a volume mapping.
    • getEbsDevice

      @Stability(Stable) @Nullable public EbsDeviceProps getEbsDevice()
      EBS device info.
    • getVirtualName

      @Stability(Stable) @Nullable public String getVirtualName()
      Virtual device name.