Skip to content

Disk

This class encapsulates and extends the ROS resource type ALIYUN::ECS::Disk.

Initializers

import com.aliyun.ros.cdk.ecs.Disk;
Disk.Builder.create(Construct scope, java.lang.String id, java.lang.Boolean enableResourcePropertyConstraint)
//  .autoSnapshotPolicyId(java.lang.String)
//  .autoSnapshotPolicyId(IResolvable)
//  .burstingEnabled(java.lang.Boolean)
//  .burstingEnabled(IResolvable)
//  .deleteAutoSnapshot(java.lang.Boolean)
//  .deleteAutoSnapshot(IResolvable)
//  .description(java.lang.String)
//  .description(IResolvable)
//  .diskCategory(java.lang.String)
//  .diskCategory(IResolvable)
//  .diskName(java.lang.String)
//  .diskName(IResolvable)
//  .encrypted(java.lang.Boolean)
//  .encrypted(IResolvable)
//  .instanceId(java.lang.String)
//  .instanceId(IResolvable)
//  .kmsKeyId(java.lang.String)
//  .kmsKeyId(IResolvable)
//  .multiAttach(java.lang.String)
//  .multiAttach(IResolvable)
//  .performanceLevel(java.lang.String)
//  .performanceLevel(IResolvable)
//  .provisionedIops(java.lang.Number)
//  .provisionedIops(IResolvable)
//  .resourceGroupId(java.lang.String)
//  .resourceGroupId(IResolvable)
//  .size(java.lang.Number)
//  .size(IResolvable)
//  .snapshotId(java.lang.String)
//  .snapshotId(IResolvable)
//  .storageSetId(java.lang.String)
//  .storageSetId(IResolvable)
//  .storageSetPartitionNumber(java.lang.Number)
//  .storageSetPartitionNumber(IResolvable)
//  .tags(java.util.List<TagsProperty>)
//  .zoneId(java.lang.String)
//  .zoneId(IResolvable)
    .build();
Name Type Description
scope com.aliyun.ros.cdk.core.Construct No description.
id java.lang.String No description.
enableResourcePropertyConstraint java.lang.Boolean No description.
autoSnapshotPolicyId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property autoSnapshotPolicyId: Auto snapshot policy ID.
burstingEnabled java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property burstingEnabled: Specifies whether to enable performance bursting.
deleteAutoSnapshot java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property deleteAutoSnapshot: Whether the auto snapshot is released with the disk.
description java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property description: Description of the disk, [2, 256] characters.
diskCategory java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property diskCategory: The disk category, now support cloud\/cloud_ssd\/cloud_essd\/cloud_efficiency\/san_ssd\/san_efficiency\/cloud_auto\/cloud_essd_entry\/cloud_regional_disk_auto\/elastic_ephemeral_disk_standard\/elastic_ephemeral_disk_premium, depends the region.
diskName java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property diskName: The name of the disk.
encrypted java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property encrypted: Whether disk is encrypted, default to false.
instanceId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property instanceId: Creates a subscription disk and automatically attaches it to the specified subscription instance.
kmsKeyId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property kmsKeyId: The ID of the KMS key to use for the disk.
multiAttach java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property multiAttach: Specifies whether to enable the multi-attach feature for the disk.
performanceLevel java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property performanceLevel: The performance level you select for an ESSD.Default value: PL1. Valid values:PL0: A single enhanced SSD delivers up to 10,000 random read\/write IOPS.PL1: A single enhanced SSD delivers up to 50,000 random read\/write IOPS.PL2: A single enhanced SSD delivers up to 100,000 random read\/write IOPS.PL3: A single enhanced SSD delivers up to 1,000,000 random read\/write IOPS.
provisionedIops java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property provisionedIops: The provisioned read\/write IOPS of a single ESSD AutoPL disk.
resourceGroupId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property resourceGroupId: Resource group id.
size java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property size: The capacity of the disk, in GiB.
snapshotId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property snapshotId: The ID of the snapshot used to create the disk.
storageSetId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property storageSetId: The ID of the storage set.
storageSetPartitionNumber java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property storageSetPartitionNumber: The number of partitions in the storage set.
tags java.util.List<TagsProperty> Property tags: Tags to attach to disk.
zoneId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property zoneId: The ID of the zone in which to create the pay-as-you-go disk.

scopeRequired

  • Type: com.aliyun.ros.cdk.core.Construct

idRequired

  • Type: java.lang.String

enableResourcePropertyConstraintOptional

  • Type: java.lang.Boolean

autoSnapshotPolicyIdOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property autoSnapshotPolicyId: Auto snapshot policy ID.


burstingEnabledOptional

  • Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable

Property burstingEnabled: Specifies whether to enable performance bursting.

Valid values:

  • true
  • false

This parameter is available only for ESSD AutoPL disks (cloud_auto). For more information, see ESSD AutoPL disks.


deleteAutoSnapshotOptional

  • Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable

Property deleteAutoSnapshot: Whether the auto snapshot is released with the disk.

Default to false.


descriptionOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property description: Description of the disk, [2, 256] characters.

Do not fill or empty, the default is empty.


diskCategoryOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property diskCategory: The disk category, now support cloud\/cloud_ssd\/cloud_essd\/cloud_efficiency\/san_ssd\/san_efficiency\/cloud_auto\/cloud_essd_entry\/cloud_regional_disk_auto\/elastic_ephemeral_disk_standard\/elastic_ephemeral_disk_premium, depends the region.


diskNameOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property diskName: The name of the disk.

The name must be 2 to 128 characters in length. It must start with a letter as defined by Unicode and can contain letters (including English and Chinese characters), digits (0-9), colons (:), underscores (_), periods (.), and hyphens (-). Default value: empty.


encryptedOptional

  • Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable

Property encrypted: Whether disk is encrypted, default to false.


instanceIdOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property instanceId: Creates a subscription disk and automatically attaches it to the specified subscription instance.

  • If you set this parameter, the ResourceGroupId, Tag.N.Key, Tag.N.Value, ClientToken, and KMSKeyId parameters are ignored.
  • You cannot specify both ZoneId and InstanceId. Default value: empty. An empty value indicates that you are creating a pay-as-you-go disk. The disk's location is determined by RegionId and ZoneId.

kmsKeyIdOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property kmsKeyId: The ID of the KMS key to use for the disk.

If Encrypted is set to true and you do not specify KMSKeyId, a default key is used for encryption. The KMSKeyId is returned in the response after the instance is created.

    • If the disk is created from an unshared encrypted snapshot, the encryption key used by that snapshot is used by default.
    • If the disk is created from a shared encrypted snapshot, the service key is used by default.
    • If the disk is created in a region with account-level default encryption enabled, the specified account-level key is used by default.
    • In other cases, the service key is used by default.

multiAttachOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property multiAttach: Specifies whether to enable the multi-attach feature for the disk.

Valid values: Disabled: disables the multi-attach feature. Enabled: enables the multi-attach feature. Set the value to Enabled only for ESSDs. Default value: Disabled.


performanceLevelOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property performanceLevel: The performance level you select for an ESSD.Default value: PL1. Valid values:PL0: A single enhanced SSD delivers up to 10,000 random read\/write IOPS.PL1: A single enhanced SSD delivers up to 50,000 random read\/write IOPS.PL2: A single enhanced SSD delivers up to 100,000 random read\/write IOPS.PL3: A single enhanced SSD delivers up to 1,000,000 random read\/write IOPS.


provisionedIopsOptional

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

Property provisionedIops: The provisioned read\/write IOPS of a single ESSD AutoPL disk.

Valid values:

  • Capacity <= 3 GiB: You cannot set provisioned performance.
  • Capacity >= 4 GiB: 0 to min(1,000 IOPS/GiB × Capacity - Baseline IOPS, 50,000). Baseline IOPS = max(min(1,800 + 50 × Capacity, 50,000), 3,000).

This parameter is available only for ESSD AutoPL disks (cloud_auto). For more information, see ESSD AutoPL disks.


resourceGroupIdOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property resourceGroupId: Resource group id.


sizeOptional

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

Property size: The capacity of the disk, in GiB.

You must specify a value for this parameter. Value range:

  • cloud: 5 to 2,000
  • cloud_efficiency: 20 to 32,768
  • cloud_ssd: 20 to 32,768
  • PerformanceLevel
  • PL0: 1 to 65,536
  • PL1: 20 to 65,536
  • PL2: 461 to 65,536
  • PL3: 1,261 to 65,536
  • cloud_auto: 1 to 65,536
  • cloud_essd_entry: 10 to 32,768
  • cloud_regional_disk_auto: 10 to 65,536
  • elastic_ephemeral_disk_standard: 64 to 8,192
  • elastic_ephemeral_disk_premium: 64 to 8,192 If you specify SnapshotId, the following limits apply to SnapshotId and Size:
  • If the snapshot capacity is greater than the specified Size, the actual disk size is the snapshot capacity.
  • If the snapshot capacity is smaller than the specified Size, the actual disk size is the specified Size.

snapshotIdOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property snapshotId: The ID of the snapshot used to create the disk.

Snapshots created on or before July 15, 2013 cannot be used to create disks. The SnapshotId and Size parameters have the following limits:

  • If the snapshot capacity is greater than the specified Size, the actual disk size is the snapshot capacity.
  • If the snapshot capacity is smaller than the specified Size, the actual disk size is the specified Size.

storageSetIdOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property storageSetId: The ID of the storage set.

You can specify either storage set parameters (StorageSetId and StorageSetPartitionNumber) or the dedicated block storage cluster parameter (StorageClusterId), but not both. The request fails if you specify parameters for both.


storageSetPartitionNumberOptional

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

Property storageSetPartitionNumber: The number of partitions in the storage set.

The value must be greater than or equal to 2 and cannot exceed the quota returned by the DescribeAccountAttributes operation. Default value: 2.


tagsOptional

Property tags: Tags to attach to disk.

Max support 20 tags to add during create disk. Each tag with two properties Key and Value, and Key is required.


zoneIdOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property zoneId: The ID of the zone in which to create the pay-as-you-go disk.

  • If you do not set InstanceId, this parameter is required.
  • You cannot specify both ZoneId and InstanceId.

ESSD zone-redundant disks (cloud_regional_disk_auto) do not require a zone ID.


Methods

Name Description
toString Returns a string representation of this construct.
synthesize Allows this construct to emit artifacts into the cloud assembly during synthesis.
addCondition No description.
addCount No description.
addDependency No description.
addResourceDesc No description.
applyRemovalPolicy No description.
fetchCondition No description.
fetchDependency No description.
fetchResourceDesc No description.
getAtt No description.
setMetadata No description.

toString

public java.lang.String toString()

Returns a string representation of this construct.

synthesize

public void synthesize(ISynthesisSession session)

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

sessionRequired

  • Type: com.aliyun.ros.cdk.core.ISynthesisSession

The synthesis session.


addCondition

public void addCondition(RosCondition condition)

conditionRequired

  • Type: com.aliyun.ros.cdk.core.RosCondition

addCount

public void addCount(java.lang.Number OR IResolvable count)

countRequired

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

addDependency

public void addDependency(Resource resource)

resourceRequired

  • Type: com.aliyun.ros.cdk.core.Resource

addResourceDesc

public void addResourceDesc(java.lang.String desc)

descRequired

  • Type: java.lang.String

applyRemovalPolicy

public void applyRemovalPolicy(RemovalPolicy policy)

policyRequired

  • Type: com.aliyun.ros.cdk.core.RemovalPolicy

fetchCondition

public RosCondition fetchCondition()

fetchDependency

public java.util.List<java.lang.String> fetchDependency()

fetchResourceDesc

public java.lang.String fetchResourceDesc()

getAtt

public IResolvable getAtt(java.lang.String name)

nameRequired

  • Type: java.lang.String

setMetadata

public void setMetadata(java.lang.String key, java.lang.Object value)

keyRequired

  • Type: java.lang.String

valueRequired

  • Type: java.lang.Object

Static Functions

Name Description
isConstruct Return whether the given object is a Construct.

isConstruct

import com.aliyun.ros.cdk.ecs.Disk;
Disk.isConstruct(java.lang.Object x)

Return whether the given object is a Construct.

xRequired

  • Type: java.lang.Object

Properties

Name Type Description
node com.aliyun.ros.cdk.core.ConstructNode The construct tree node associated with this construct.
env com.aliyun.ros.cdk.core.IResourceEnvironment The environment this resource belongs to.
ref java.lang.String No description.
stack com.aliyun.ros.cdk.core.Stack The stack in which this resource is defined.
resource com.aliyun.ros.cdk.core.RosResource No description.
attrDiskId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute DiskId: Id of created disk.
attrStatus java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute Status: Created disk status.
props DiskProps No description.

nodeRequired

public ConstructNode getNode();
  • Type: com.aliyun.ros.cdk.core.ConstructNode

The construct tree node associated with this construct.


envRequired

public IResourceEnvironment getEnv();
  • Type: com.aliyun.ros.cdk.core.IResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


refRequired

public java.lang.String getRef();
  • Type: java.lang.String

stackRequired

public Stack getStack();
  • Type: com.aliyun.ros.cdk.core.Stack

The stack in which this resource is defined.


resourceOptional

public RosResource getResource();
  • Type: com.aliyun.ros.cdk.core.RosResource

attrDiskIdRequired

public java.lang.Object getAttrDiskId();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute DiskId: Id of created disk.


attrStatusRequired

public java.lang.Object getAttrStatus();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute Status: Created disk status.


propsRequired

public DiskProps getProps();