Class CreateVolumeRequest

java.lang.Object
com.amazonaws.AmazonWebServiceRequest
com.amazonaws.services.ec2.model.CreateVolumeRequest
All Implemented Interfaces:
ReadLimitInfo, DryRunSupportedRequest<CreateVolumeRequest>, Serializable, Cloneable

public class CreateVolumeRequest extends AmazonWebServiceRequest implements Serializable, Cloneable, DryRunSupportedRequest<CreateVolumeRequest>

Contains the parameters for CreateVolume.

See Also:
  • Constructor Details

    • CreateVolumeRequest

      public CreateVolumeRequest()
      Default constructor for CreateVolumeRequest object. Callers should use the setter or fluent setter (with...) methods to initialize the object after creating it.
    • CreateVolumeRequest

      public CreateVolumeRequest(Integer size, String availabilityZone)
      Constructs a new CreateVolumeRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.
      Parameters:
      size - The size of the volume, in GiBs.

      Constraints: 1-16384 for gp2, 4-16384 for io1, 500-16384 for st1, 500-16384 for sc1, and 1-1024 for standard. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.

      Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.

      availabilityZone - The Availability Zone in which to create the volume. Use DescribeAvailabilityZones to list the Availability Zones that are currently available to you.
    • CreateVolumeRequest

      public CreateVolumeRequest(String snapshotId, String availabilityZone)
      Constructs a new CreateVolumeRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.
      Parameters:
      snapshotId - The snapshot from which to create the volume.
      availabilityZone - The Availability Zone in which to create the volume. Use DescribeAvailabilityZones to list the Availability Zones that are currently available to you.
  • Method Details

    • setSize

      public void setSize(Integer size)

      The size of the volume, in GiBs.

      Constraints: 1-16384 for gp2, 4-16384 for io1, 500-16384 for st1, 500-16384 for sc1, and 1-1024 for standard. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.

      Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.

      Parameters:
      size - The size of the volume, in GiBs.

      Constraints: 1-16384 for gp2, 4-16384 for io1, 500-16384 for st1, 500-16384 for sc1, and 1-1024 for standard. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.

      Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.

    • getSize

      public Integer getSize()

      The size of the volume, in GiBs.

      Constraints: 1-16384 for gp2, 4-16384 for io1, 500-16384 for st1, 500-16384 for sc1, and 1-1024 for standard. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.

      Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.

      Returns:
      The size of the volume, in GiBs.

      Constraints: 1-16384 for gp2, 4-16384 for io1, 500-16384 for st1, 500-16384 for sc1, and 1-1024 for standard. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.

      Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.

    • withSize

      public CreateVolumeRequest withSize(Integer size)

      The size of the volume, in GiBs.

      Constraints: 1-16384 for gp2, 4-16384 for io1, 500-16384 for st1, 500-16384 for sc1, and 1-1024 for standard. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.

      Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.

      Parameters:
      size - The size of the volume, in GiBs.

      Constraints: 1-16384 for gp2, 4-16384 for io1, 500-16384 for st1, 500-16384 for sc1, and 1-1024 for standard. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.

      Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setSnapshotId

      public void setSnapshotId(String snapshotId)

      The snapshot from which to create the volume.

      Parameters:
      snapshotId - The snapshot from which to create the volume.
    • getSnapshotId

      public String getSnapshotId()

      The snapshot from which to create the volume.

      Returns:
      The snapshot from which to create the volume.
    • withSnapshotId

      public CreateVolumeRequest withSnapshotId(String snapshotId)

      The snapshot from which to create the volume.

      Parameters:
      snapshotId - The snapshot from which to create the volume.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setAvailabilityZone

      public void setAvailabilityZone(String availabilityZone)

      The Availability Zone in which to create the volume. Use DescribeAvailabilityZones to list the Availability Zones that are currently available to you.

      Parameters:
      availabilityZone - The Availability Zone in which to create the volume. Use DescribeAvailabilityZones to list the Availability Zones that are currently available to you.
    • getAvailabilityZone

      public String getAvailabilityZone()

      The Availability Zone in which to create the volume. Use DescribeAvailabilityZones to list the Availability Zones that are currently available to you.

      Returns:
      The Availability Zone in which to create the volume. Use DescribeAvailabilityZones to list the Availability Zones that are currently available to you.
    • withAvailabilityZone

      public CreateVolumeRequest withAvailabilityZone(String availabilityZone)

      The Availability Zone in which to create the volume. Use DescribeAvailabilityZones to list the Availability Zones that are currently available to you.

      Parameters:
      availabilityZone - The Availability Zone in which to create the volume. Use DescribeAvailabilityZones to list the Availability Zones that are currently available to you.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setVolumeType

      public void setVolumeType(String volumeType)

      The volume type. This can be gp2 for General Purpose SSD, io1 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard for Magnetic volumes.

      Default: standard

      Parameters:
      volumeType - The volume type. This can be gp2 for General Purpose SSD, io1 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard for Magnetic volumes.

      Default: standard

      See Also:
    • getVolumeType

      public String getVolumeType()

      The volume type. This can be gp2 for General Purpose SSD, io1 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard for Magnetic volumes.

      Default: standard

      Returns:
      The volume type. This can be gp2 for General Purpose SSD, io1 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard for Magnetic volumes.

      Default: standard

      See Also:
    • withVolumeType

      public CreateVolumeRequest withVolumeType(String volumeType)

      The volume type. This can be gp2 for General Purpose SSD, io1 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard for Magnetic volumes.

      Default: standard

      Parameters:
      volumeType - The volume type. This can be gp2 for General Purpose SSD, io1 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard for Magnetic volumes.

      Default: standard

      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • setVolumeType

      public void setVolumeType(VolumeType volumeType)

      The volume type. This can be gp2 for General Purpose SSD, io1 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard for Magnetic volumes.

      Default: standard

      Parameters:
      volumeType - The volume type. This can be gp2 for General Purpose SSD, io1 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard for Magnetic volumes.

      Default: standard

      See Also:
    • withVolumeType

      public CreateVolumeRequest withVolumeType(VolumeType volumeType)

      The volume type. This can be gp2 for General Purpose SSD, io1 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard for Magnetic volumes.

      Default: standard

      Parameters:
      volumeType - The volume type. This can be gp2 for General Purpose SSD, io1 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard for Magnetic volumes.

      Default: standard

      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • setIops

      public void setIops(Integer iops)

      Only valid for Provisioned IOPS SSD volumes. The number of I/O operations per second (IOPS) to provision for the volume, with a maximum ratio of 30 IOPS/GiB.

      Constraint: Range is 100 to 20000 for Provisioned IOPS SSD volumes

      Parameters:
      iops - Only valid for Provisioned IOPS SSD volumes. The number of I/O operations per second (IOPS) to provision for the volume, with a maximum ratio of 30 IOPS/GiB.

      Constraint: Range is 100 to 20000 for Provisioned IOPS SSD volumes

    • getIops

      public Integer getIops()

      Only valid for Provisioned IOPS SSD volumes. The number of I/O operations per second (IOPS) to provision for the volume, with a maximum ratio of 30 IOPS/GiB.

      Constraint: Range is 100 to 20000 for Provisioned IOPS SSD volumes

      Returns:
      Only valid for Provisioned IOPS SSD volumes. The number of I/O operations per second (IOPS) to provision for the volume, with a maximum ratio of 30 IOPS/GiB.

      Constraint: Range is 100 to 20000 for Provisioned IOPS SSD volumes

    • withIops

      public CreateVolumeRequest withIops(Integer iops)

      Only valid for Provisioned IOPS SSD volumes. The number of I/O operations per second (IOPS) to provision for the volume, with a maximum ratio of 30 IOPS/GiB.

      Constraint: Range is 100 to 20000 for Provisioned IOPS SSD volumes

      Parameters:
      iops - Only valid for Provisioned IOPS SSD volumes. The number of I/O operations per second (IOPS) to provision for the volume, with a maximum ratio of 30 IOPS/GiB.

      Constraint: Range is 100 to 20000 for Provisioned IOPS SSD volumes

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • setEncrypted

      public void setEncrypted(Boolean encrypted)

      Specifies whether the volume should be encrypted. Encrypted Amazon EBS volumes may only be attached to instances that support Amazon EBS encryption. Volumes that are created from encrypted snapshots are automatically encrypted. There is no way to create an encrypted volume from an unencrypted snapshot or vice versa. If your AMI uses encrypted volumes, you can only launch it on supported instance types. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide.

      Parameters:
      encrypted - Specifies whether the volume should be encrypted. Encrypted Amazon EBS volumes may only be attached to instances that support Amazon EBS encryption. Volumes that are created from encrypted snapshots are automatically encrypted. There is no way to create an encrypted volume from an unencrypted snapshot or vice versa. If your AMI uses encrypted volumes, you can only launch it on supported instance types. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide.
    • getEncrypted

      public Boolean getEncrypted()

      Specifies whether the volume should be encrypted. Encrypted Amazon EBS volumes may only be attached to instances that support Amazon EBS encryption. Volumes that are created from encrypted snapshots are automatically encrypted. There is no way to create an encrypted volume from an unencrypted snapshot or vice versa. If your AMI uses encrypted volumes, you can only launch it on supported instance types. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide.

      Returns:
      Specifies whether the volume should be encrypted. Encrypted Amazon EBS volumes may only be attached to instances that support Amazon EBS encryption. Volumes that are created from encrypted snapshots are automatically encrypted. There is no way to create an encrypted volume from an unencrypted snapshot or vice versa. If your AMI uses encrypted volumes, you can only launch it on supported instance types. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide.
    • withEncrypted

      public CreateVolumeRequest withEncrypted(Boolean encrypted)

      Specifies whether the volume should be encrypted. Encrypted Amazon EBS volumes may only be attached to instances that support Amazon EBS encryption. Volumes that are created from encrypted snapshots are automatically encrypted. There is no way to create an encrypted volume from an unencrypted snapshot or vice versa. If your AMI uses encrypted volumes, you can only launch it on supported instance types. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide.

      Parameters:
      encrypted - Specifies whether the volume should be encrypted. Encrypted Amazon EBS volumes may only be attached to instances that support Amazon EBS encryption. Volumes that are created from encrypted snapshots are automatically encrypted. There is no way to create an encrypted volume from an unencrypted snapshot or vice versa. If your AMI uses encrypted volumes, you can only launch it on supported instance types. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • isEncrypted

      public Boolean isEncrypted()

      Specifies whether the volume should be encrypted. Encrypted Amazon EBS volumes may only be attached to instances that support Amazon EBS encryption. Volumes that are created from encrypted snapshots are automatically encrypted. There is no way to create an encrypted volume from an unencrypted snapshot or vice versa. If your AMI uses encrypted volumes, you can only launch it on supported instance types. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide.

      Returns:
      Specifies whether the volume should be encrypted. Encrypted Amazon EBS volumes may only be attached to instances that support Amazon EBS encryption. Volumes that are created from encrypted snapshots are automatically encrypted. There is no way to create an encrypted volume from an unencrypted snapshot or vice versa. If your AMI uses encrypted volumes, you can only launch it on supported instance types. For more information, see Amazon EBS Encryption in the Amazon Elastic Compute Cloud User Guide.
    • setKmsKeyId

      public void setKmsKeyId(String kmsKeyId)

      The full ARN of the AWS Key Management Service (AWS KMS) customer master key (CMK) to use when creating the encrypted volume. This parameter is only required if you want to use a non-default CMK; if this parameter is not specified, the default CMK for EBS is used. The ARN contains the arn:aws:kms namespace, followed by the region of the CMK, the AWS account ID of the CMK owner, the key namespace, and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910 :key/abcd1234-a123-456a-a12b-a123b4cd56ef. If a KmsKeyId is specified, the Encrypted flag must also be set.

      Parameters:
      kmsKeyId - The full ARN of the AWS Key Management Service (AWS KMS) customer master key (CMK) to use when creating the encrypted volume. This parameter is only required if you want to use a non-default CMK; if this parameter is not specified, the default CMK for EBS is used. The ARN contains the arn:aws:kms namespace, followed by the region of the CMK, the AWS account ID of the CMK owner, the key namespace, and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234 -a123-456a-a12b-a123b4cd56ef. If a KmsKeyId is specified, the Encrypted flag must also be set.
    • getKmsKeyId

      public String getKmsKeyId()

      The full ARN of the AWS Key Management Service (AWS KMS) customer master key (CMK) to use when creating the encrypted volume. This parameter is only required if you want to use a non-default CMK; if this parameter is not specified, the default CMK for EBS is used. The ARN contains the arn:aws:kms namespace, followed by the region of the CMK, the AWS account ID of the CMK owner, the key namespace, and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910 :key/abcd1234-a123-456a-a12b-a123b4cd56ef. If a KmsKeyId is specified, the Encrypted flag must also be set.

      Returns:
      The full ARN of the AWS Key Management Service (AWS KMS) customer master key (CMK) to use when creating the encrypted volume. This parameter is only required if you want to use a non-default CMK; if this parameter is not specified, the default CMK for EBS is used. The ARN contains the arn:aws:kms namespace, followed by the region of the CMK, the AWS account ID of the CMK owner, the key namespace, and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910:key/ abcd1234-a123-456a-a12b-a123b4cd56ef. If a KmsKeyId is specified, the Encrypted flag must also be set.
    • withKmsKeyId

      public CreateVolumeRequest withKmsKeyId(String kmsKeyId)

      The full ARN of the AWS Key Management Service (AWS KMS) customer master key (CMK) to use when creating the encrypted volume. This parameter is only required if you want to use a non-default CMK; if this parameter is not specified, the default CMK for EBS is used. The ARN contains the arn:aws:kms namespace, followed by the region of the CMK, the AWS account ID of the CMK owner, the key namespace, and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910 :key/abcd1234-a123-456a-a12b-a123b4cd56ef. If a KmsKeyId is specified, the Encrypted flag must also be set.

      Parameters:
      kmsKeyId - The full ARN of the AWS Key Management Service (AWS KMS) customer master key (CMK) to use when creating the encrypted volume. This parameter is only required if you want to use a non-default CMK; if this parameter is not specified, the default CMK for EBS is used. The ARN contains the arn:aws:kms namespace, followed by the region of the CMK, the AWS account ID of the CMK owner, the key namespace, and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234 -a123-456a-a12b-a123b4cd56ef. If a KmsKeyId is specified, the Encrypted flag must also be set.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • getDryRunRequest

      public Request<CreateVolumeRequest> getDryRunRequest()
      This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run.
      Specified by:
      getDryRunRequest in interface DryRunSupportedRequest<CreateVolumeRequest>
    • toString

      public String toString()
      Returns a string representation of this object; useful for testing and debugging.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this object.
      See Also:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • clone

      public CreateVolumeRequest clone()
      Description copied from class: AmazonWebServiceRequest
      Creates a shallow clone of this request. Explicitly does not clone the deep structure of the request object.
      Overrides:
      clone in class AmazonWebServiceRequest
      See Also: