Disk

Provides a ECS disk resource.

NOTE: One of size or snapshot_id is required when specifying an ECS disk. If all of them be specified, size must more than the size of snapshot which snapshot_id represents. Currently, alicloud.ecs.Disk doesn’t resize disk.

Create a Disk Resource

new Disk(name: string, args: DiskArgs, opts?: CustomResourceOptions);
def Disk(resource_name, opts=None, availability_zone=None, category=None, delete_auto_snapshot=None, delete_with_instance=None, description=None, enable_auto_snapshot=None, encrypted=None, kms_key_id=None, name=None, resource_group_id=None, size=None, snapshot_id=None, tags=None, __props__=None);
func NewDisk(ctx *Context, name string, args DiskArgs, opts ...ResourceOption) (*Disk, error)
public Disk(string name, DiskArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args DiskArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args DiskArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DiskArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Disk Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Disk resource accepts the following input properties:

AvailabilityZone string

The Zone to create the disk in.

Size int

The size of the disk in GiBs. When resize the disk, the new size must be greater than the former value, or you would get an error InvalidDiskSize.TooSmall.

Category string

Category of the disk. Valid values are cloud, cloud_efficiency, cloud_ssd, cloud_essd. Default is cloud_efficiency.

DeleteAutoSnapshot bool

Indicates whether the automatic snapshot is deleted when the disk is released. Default value: false.

DeleteWithInstance bool

Indicates whether the disk is released together with the instance: Default value: false.

Description string

Description of the disk. This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Default value is null.

EnableAutoSnapshot bool

Indicates whether to apply a created automatic snapshot policy to the disk. Default value: false.

Encrypted bool

If true, the disk will be encrypted, conflict with snapshot_id.

KmsKeyId string

The ID of the KMS key corresponding to the data disk, The specified parameter Encrypted must be true when KmsKeyId is not empty.

Name string

Name of the ECS disk. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as “-”,“.”,”_“, and must not begin or end with a hyphen, and must not begin with http:// or https://. Default value is null.

ResourceGroupId string

The Id of resource group which the disk belongs. > NOTE: Disk category cloud has been outdated and it only can be used none I/O Optimized ECS instances. Recommend cloud_efficiency and cloud_ssd disk.

SnapshotId string

A snapshot to base the disk off of. If the disk size required by snapshot is greater than size, the size will be ignored, conflict with encrypted.

Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

AvailabilityZone string

The Zone to create the disk in.

Size int

The size of the disk in GiBs. When resize the disk, the new size must be greater than the former value, or you would get an error InvalidDiskSize.TooSmall.

Category string

Category of the disk. Valid values are cloud, cloud_efficiency, cloud_ssd, cloud_essd. Default is cloud_efficiency.

DeleteAutoSnapshot bool

Indicates whether the automatic snapshot is deleted when the disk is released. Default value: false.

DeleteWithInstance bool

Indicates whether the disk is released together with the instance: Default value: false.

Description string

Description of the disk. This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Default value is null.

EnableAutoSnapshot bool

Indicates whether to apply a created automatic snapshot policy to the disk. Default value: false.

Encrypted bool

If true, the disk will be encrypted, conflict with snapshot_id.

KmsKeyId string

The ID of the KMS key corresponding to the data disk, The specified parameter Encrypted must be true when KmsKeyId is not empty.

Name string

Name of the ECS disk. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as “-”,“.”,”_“, and must not begin or end with a hyphen, and must not begin with http:// or https://. Default value is null.

ResourceGroupId string

The Id of resource group which the disk belongs. > NOTE: Disk category cloud has been outdated and it only can be used none I/O Optimized ECS instances. Recommend cloud_efficiency and cloud_ssd disk.

SnapshotId string

A snapshot to base the disk off of. If the disk size required by snapshot is greater than size, the size will be ignored, conflict with encrypted.

Tags map[string]interface{}

A mapping of tags to assign to the resource.

availabilityZone string

The Zone to create the disk in.

size number

The size of the disk in GiBs. When resize the disk, the new size must be greater than the former value, or you would get an error InvalidDiskSize.TooSmall.

category string

Category of the disk. Valid values are cloud, cloud_efficiency, cloud_ssd, cloud_essd. Default is cloud_efficiency.

deleteAutoSnapshot boolean

Indicates whether the automatic snapshot is deleted when the disk is released. Default value: false.

deleteWithInstance boolean

Indicates whether the disk is released together with the instance: Default value: false.

description string

Description of the disk. This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Default value is null.

enableAutoSnapshot boolean

Indicates whether to apply a created automatic snapshot policy to the disk. Default value: false.

encrypted boolean

If true, the disk will be encrypted, conflict with snapshot_id.

kmsKeyId string

The ID of the KMS key corresponding to the data disk, The specified parameter Encrypted must be true when KmsKeyId is not empty.

name string

Name of the ECS disk. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as “-”,“.”,”_“, and must not begin or end with a hyphen, and must not begin with http:// or https://. Default value is null.

resourceGroupId string

The Id of resource group which the disk belongs. > NOTE: Disk category cloud has been outdated and it only can be used none I/O Optimized ECS instances. Recommend cloud_efficiency and cloud_ssd disk.

snapshotId string

A snapshot to base the disk off of. If the disk size required by snapshot is greater than size, the size will be ignored, conflict with encrypted.

tags {[key: string]: any}

A mapping of tags to assign to the resource.

availability_zone str

The Zone to create the disk in.

size float

The size of the disk in GiBs. When resize the disk, the new size must be greater than the former value, or you would get an error InvalidDiskSize.TooSmall.

category str

Category of the disk. Valid values are cloud, cloud_efficiency, cloud_ssd, cloud_essd. Default is cloud_efficiency.

delete_auto_snapshot bool

Indicates whether the automatic snapshot is deleted when the disk is released. Default value: false.

delete_with_instance bool

Indicates whether the disk is released together with the instance: Default value: false.

description str

Description of the disk. This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Default value is null.

enable_auto_snapshot bool

Indicates whether to apply a created automatic snapshot policy to the disk. Default value: false.

encrypted bool

If true, the disk will be encrypted, conflict with snapshot_id.

kms_key_id str

The ID of the KMS key corresponding to the data disk, The specified parameter Encrypted must be true when KmsKeyId is not empty.

name str

Name of the ECS disk. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as “-”,“.”,”_“, and must not begin or end with a hyphen, and must not begin with http:// or https://. Default value is null.

resource_group_id str

The Id of resource group which the disk belongs. > NOTE: Disk category cloud has been outdated and it only can be used none I/O Optimized ECS instances. Recommend cloud_efficiency and cloud_ssd disk.

snapshot_id str

A snapshot to base the disk off of. If the disk size required by snapshot is greater than size, the size will be ignored, conflict with encrypted.

tags Dict[str, Any]

A mapping of tags to assign to the resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the Disk resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Status string

The disk status.

Id string
The provider-assigned unique ID for this managed resource.
Status string

The disk status.

id string
The provider-assigned unique ID for this managed resource.
status string

The disk status.

id str
The provider-assigned unique ID for this managed resource.
status str

The disk status.

Look up an Existing Disk Resource

Get an existing Disk resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: DiskState, opts?: CustomResourceOptions): Disk
static get(resource_name, id, opts=None, availability_zone=None, category=None, delete_auto_snapshot=None, delete_with_instance=None, description=None, enable_auto_snapshot=None, encrypted=None, kms_key_id=None, name=None, resource_group_id=None, size=None, snapshot_id=None, status=None, tags=None, __props__=None);
func GetDisk(ctx *Context, name string, id IDInput, state *DiskState, opts ...ResourceOption) (*Disk, error)
public static Disk Get(string name, Input<string> id, DiskState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

AvailabilityZone string

The Zone to create the disk in.

Category string

Category of the disk. Valid values are cloud, cloud_efficiency, cloud_ssd, cloud_essd. Default is cloud_efficiency.

DeleteAutoSnapshot bool

Indicates whether the automatic snapshot is deleted when the disk is released. Default value: false.

DeleteWithInstance bool

Indicates whether the disk is released together with the instance: Default value: false.

Description string

Description of the disk. This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Default value is null.

EnableAutoSnapshot bool

Indicates whether to apply a created automatic snapshot policy to the disk. Default value: false.

Encrypted bool

If true, the disk will be encrypted, conflict with snapshot_id.

KmsKeyId string

The ID of the KMS key corresponding to the data disk, The specified parameter Encrypted must be true when KmsKeyId is not empty.

Name string

Name of the ECS disk. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as “-”,“.”,”_“, and must not begin or end with a hyphen, and must not begin with http:// or https://. Default value is null.

ResourceGroupId string

The Id of resource group which the disk belongs. > NOTE: Disk category cloud has been outdated and it only can be used none I/O Optimized ECS instances. Recommend cloud_efficiency and cloud_ssd disk.

Size int

The size of the disk in GiBs. When resize the disk, the new size must be greater than the former value, or you would get an error InvalidDiskSize.TooSmall.

SnapshotId string

A snapshot to base the disk off of. If the disk size required by snapshot is greater than size, the size will be ignored, conflict with encrypted.

Status string

The disk status.

Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

AvailabilityZone string

The Zone to create the disk in.

Category string

Category of the disk. Valid values are cloud, cloud_efficiency, cloud_ssd, cloud_essd. Default is cloud_efficiency.

DeleteAutoSnapshot bool

Indicates whether the automatic snapshot is deleted when the disk is released. Default value: false.

DeleteWithInstance bool

Indicates whether the disk is released together with the instance: Default value: false.

Description string

Description of the disk. This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Default value is null.

EnableAutoSnapshot bool

Indicates whether to apply a created automatic snapshot policy to the disk. Default value: false.

Encrypted bool

If true, the disk will be encrypted, conflict with snapshot_id.

KmsKeyId string

The ID of the KMS key corresponding to the data disk, The specified parameter Encrypted must be true when KmsKeyId is not empty.

Name string

Name of the ECS disk. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as “-”,“.”,”_“, and must not begin or end with a hyphen, and must not begin with http:// or https://. Default value is null.

ResourceGroupId string

The Id of resource group which the disk belongs. > NOTE: Disk category cloud has been outdated and it only can be used none I/O Optimized ECS instances. Recommend cloud_efficiency and cloud_ssd disk.

Size int

The size of the disk in GiBs. When resize the disk, the new size must be greater than the former value, or you would get an error InvalidDiskSize.TooSmall.

SnapshotId string

A snapshot to base the disk off of. If the disk size required by snapshot is greater than size, the size will be ignored, conflict with encrypted.

Status string

The disk status.

Tags map[string]interface{}

A mapping of tags to assign to the resource.

availabilityZone string

The Zone to create the disk in.

category string

Category of the disk. Valid values are cloud, cloud_efficiency, cloud_ssd, cloud_essd. Default is cloud_efficiency.

deleteAutoSnapshot boolean

Indicates whether the automatic snapshot is deleted when the disk is released. Default value: false.

deleteWithInstance boolean

Indicates whether the disk is released together with the instance: Default value: false.

description string

Description of the disk. This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Default value is null.

enableAutoSnapshot boolean

Indicates whether to apply a created automatic snapshot policy to the disk. Default value: false.

encrypted boolean

If true, the disk will be encrypted, conflict with snapshot_id.

kmsKeyId string

The ID of the KMS key corresponding to the data disk, The specified parameter Encrypted must be true when KmsKeyId is not empty.

name string

Name of the ECS disk. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as “-”,“.”,”_“, and must not begin or end with a hyphen, and must not begin with http:// or https://. Default value is null.

resourceGroupId string

The Id of resource group which the disk belongs. > NOTE: Disk category cloud has been outdated and it only can be used none I/O Optimized ECS instances. Recommend cloud_efficiency and cloud_ssd disk.

size number

The size of the disk in GiBs. When resize the disk, the new size must be greater than the former value, or you would get an error InvalidDiskSize.TooSmall.

snapshotId string

A snapshot to base the disk off of. If the disk size required by snapshot is greater than size, the size will be ignored, conflict with encrypted.

status string

The disk status.

tags {[key: string]: any}

A mapping of tags to assign to the resource.

availability_zone str

The Zone to create the disk in.

category str

Category of the disk. Valid values are cloud, cloud_efficiency, cloud_ssd, cloud_essd. Default is cloud_efficiency.

delete_auto_snapshot bool

Indicates whether the automatic snapshot is deleted when the disk is released. Default value: false.

delete_with_instance bool

Indicates whether the disk is released together with the instance: Default value: false.

description str

Description of the disk. This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Default value is null.

enable_auto_snapshot bool

Indicates whether to apply a created automatic snapshot policy to the disk. Default value: false.

encrypted bool

If true, the disk will be encrypted, conflict with snapshot_id.

kms_key_id str

The ID of the KMS key corresponding to the data disk, The specified parameter Encrypted must be true when KmsKeyId is not empty.

name str

Name of the ECS disk. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as “-”,“.”,”_“, and must not begin or end with a hyphen, and must not begin with http:// or https://. Default value is null.

resource_group_id str

The Id of resource group which the disk belongs. > NOTE: Disk category cloud has been outdated and it only can be used none I/O Optimized ECS instances. Recommend cloud_efficiency and cloud_ssd disk.

size float

The size of the disk in GiBs. When resize the disk, the new size must be greater than the former value, or you would get an error InvalidDiskSize.TooSmall.

snapshot_id str

A snapshot to base the disk off of. If the disk size required by snapshot is greater than size, the size will be ignored, conflict with encrypted.

status str

The disk status.

tags Dict[str, Any]

A mapping of tags to assign to the resource.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.