Skip to content

Disk

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

Initializers

import ros_cdk_ecs
ros_cdk_ecs.Disk(
  scope: Construct,
  id: str,
  auto_snapshot_policy_id: typing.Union[str, IResolvable] = None,
  bursting_enabled: typing.Union[bool, IResolvable] = None,
  delete_auto_snapshot: typing.Union[bool, IResolvable] = None,
  description: typing.Union[str, IResolvable] = None,
  disk_category: typing.Union[str, IResolvable] = None,
  disk_name: typing.Union[str, IResolvable] = None,
  encrypted: typing.Union[bool, IResolvable] = None,
  instance_id: typing.Union[str, IResolvable] = None,
  kms_key_id: typing.Union[str, IResolvable] = None,
  multi_attach: typing.Union[str, IResolvable] = None,
  performance_level: typing.Union[str, IResolvable] = None,
  provisioned_iops: typing.Union[typing.Union[int, float], IResolvable] = None,
  resource_group_id: typing.Union[str, IResolvable] = None,
  size: typing.Union[typing.Union[int, float], IResolvable] = None,
  snapshot_id: typing.Union[str, IResolvable] = None,
  storage_set_id: typing.Union[str, IResolvable] = None,
  storage_set_partition_number: typing.Union[typing.Union[int, float], IResolvable] = None,
  tags: typing.List[TagsProperty] = None,
  zone_id: typing.Union[str, IResolvable] = None,
  enable_resource_property_constraint: bool = None
)
Name Type Description
scope ros_cdk_core.Construct No description.
id str No description.
auto_snapshot_policy_id typing.Union[str, ros_cdk_core.IResolvable] Property autoSnapshotPolicyId: Auto snapshot policy ID.
bursting_enabled typing.Union[bool, ros_cdk_core.IResolvable] Property burstingEnabled: Specifies whether to enable performance bursting.
delete_auto_snapshot typing.Union[bool, ros_cdk_core.IResolvable] Property deleteAutoSnapshot: Whether the auto snapshot is released with the disk.
description typing.Union[str, ros_cdk_core.IResolvable] Property description: Description of the disk, [2, 256] characters.
disk_category typing.Union[str, 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.
disk_name typing.Union[str, ros_cdk_core.IResolvable] Property diskName: The name of the disk.
encrypted typing.Union[bool, ros_cdk_core.IResolvable] Property encrypted: Whether disk is encrypted, default to false.
instance_id typing.Union[str, ros_cdk_core.IResolvable] Property instanceId: Creates a subscription disk and automatically attaches it to the specified subscription instance.
kms_key_id typing.Union[str, ros_cdk_core.IResolvable] Property kmsKeyId: The ID of the KMS key to use for the disk.
multi_attach typing.Union[str, ros_cdk_core.IResolvable] Property multiAttach: Specifies whether to enable the multi-attach feature for the disk.
performance_level typing.Union[str, 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.
provisioned_iops typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property provisionedIops: The provisioned read\/write IOPS of a single ESSD AutoPL disk.
resource_group_id typing.Union[str, ros_cdk_core.IResolvable] Property resourceGroupId: Resource group id.
size typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property size: The capacity of the disk, in GiB.
snapshot_id typing.Union[str, ros_cdk_core.IResolvable] Property snapshotId: The ID of the snapshot used to create the disk.
storage_set_id typing.Union[str, ros_cdk_core.IResolvable] Property storageSetId: The ID of the storage set.
storage_set_partition_number typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property storageSetPartitionNumber: The number of partitions in the storage set.
tags typing.List[TagsProperty] Property tags: Tags to attach to disk.
zone_id typing.Union[str, ros_cdk_core.IResolvable] Property zoneId: The ID of the zone in which to create the pay-as-you-go disk.
enable_resource_property_constraint bool No description.

scopeRequired

  • Type: ros_cdk_core.Construct

idRequired

  • Type: str

auto_snapshot_policy_idOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property autoSnapshotPolicyId: Auto snapshot policy ID.


bursting_enabledOptional

  • Type: typing.Union[bool, 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.


delete_auto_snapshotOptional

  • Type: typing.Union[bool, ros_cdk_core.IResolvable]

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

Default to false.


descriptionOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

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

Do not fill or empty, the default is empty.


disk_categoryOptional

  • Type: typing.Union[str, 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.


disk_nameOptional

  • Type: typing.Union[str, 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: typing.Union[bool, ros_cdk_core.IResolvable]

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


instance_idOptional

  • Type: typing.Union[str, 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.

kms_key_idOptional

  • Type: typing.Union[str, 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.

multi_attachOptional

  • Type: typing.Union[str, 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.


performance_levelOptional

  • Type: typing.Union[str, 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.


provisioned_iopsOptional

  • Type: typing.Union[typing.Union[int, float], 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.


resource_group_idOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property resourceGroupId: Resource group id.


sizeOptional

  • Type: typing.Union[typing.Union[int, float], 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.

snapshot_idOptional

  • Type: typing.Union[str, 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.

storage_set_idOptional

  • Type: typing.Union[str, 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.


storage_set_partition_numberOptional

  • Type: typing.Union[typing.Union[int, float], 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.


zone_idOptional

  • Type: typing.Union[str, 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.


enable_resource_property_constraintOptional

  • Type: bool

Methods

Name Description
to_string Returns a string representation of this construct.
synthesize Allows this construct to emit artifacts into the cloud assembly during synthesis.
add_condition No description.
add_count No description.
add_dependency No description.
add_resource_desc No description.
apply_removal_policy No description.
fetch_condition No description.
fetch_dependency No description.
fetch_resource_desc No description.
get_att No description.
set_metadata No description.

to_string

def to_string() -> str

Returns a string representation of this construct.

synthesize

def synthesize(
  session: ISynthesisSession
) -> None

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: ros_cdk_core.ISynthesisSession

The synthesis session.


add_condition

def add_condition(
  condition: RosCondition
) -> None

conditionRequired

  • Type: ros_cdk_core.RosCondition

add_count

def add_count(
  count: typing.Union[typing.Union[int, float], IResolvable]
) -> None

countRequired

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

add_dependency

def add_dependency(
  resource: Resource
) -> None

resourceRequired

  • Type: ros_cdk_core.Resource

add_resource_desc

def add_resource_desc(
  desc: str
) -> None

descRequired

  • Type: str

apply_removal_policy

def apply_removal_policy(
  policy: RemovalPolicy
) -> None

policyRequired

  • Type: ros_cdk_core.RemovalPolicy

fetch_condition

def fetch_condition() -> RosCondition

fetch_dependency

def fetch_dependency() -> typing.List[str]

fetch_resource_desc

def fetch_resource_desc() -> str

get_att

def get_att(
  name: str
) -> IResolvable

nameRequired

  • Type: str

set_metadata

def set_metadata(
  key: str,
  value: typing.Any
) -> None

keyRequired

  • Type: str

valueRequired

  • Type: typing.Any

Static Functions

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

is_construct

import ros_cdk_ecs
ros_cdk_ecs.Disk.is_construct(
  x: typing.Any
)

Return whether the given object is a Construct.

xRequired

  • Type: typing.Any

Properties

Name Type Description
node ros_cdk_core.ConstructNode The construct tree node associated with this construct.
env ros_cdk_core.IResourceEnvironment The environment this resource belongs to.
ref str No description.
stack ros_cdk_core.Stack The stack in which this resource is defined.
resource ros_cdk_core.RosResource No description.
attr_disk_id typing.Union[str, ros_cdk_core.IResolvable] Attribute DiskId: Id of created disk.
attr_status typing.Union[str, ros_cdk_core.IResolvable] Attribute Status: Created disk status.
props DiskProps No description.

nodeRequired

node: ConstructNode
  • Type: ros_cdk_core.ConstructNode

The construct tree node associated with this construct.


envRequired

env: IResourceEnvironment
  • Type: 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

ref: str
  • Type: str

stackRequired

stack: Stack
  • Type: ros_cdk_core.Stack

The stack in which this resource is defined.


resourceOptional

resource: RosResource
  • Type: ros_cdk_core.RosResource

attr_disk_idRequired

attr_disk_id: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Attribute DiskId: Id of created disk.


attr_statusRequired

attr_status: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Attribute Status: Created disk status.


propsRequired

props: DiskProps