Disk
Provides a ECS disk resource.
NOTE: One of
sizeorsnapshot_idis required when specifying an ECS disk. If all of them be specified,sizemust more than the size of snapshot whichsnapshot_idrepresents. Currently,alicloud.ecs.Diskdoesn’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);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:
- Availability
Zone 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 iscloud_efficiency.- Delete
Auto boolSnapshot Indicates whether the automatic snapshot is deleted when the disk is released. Default value: false.
- Delete
With boolInstance 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.
- Enable
Auto boolSnapshot 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 stringId The ID of the KMS key corresponding to the data disk, The specified parameter
Encryptedmust betruewhen 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.
- Resource
Group stringId The Id of resource group which the disk belongs. > NOTE: Disk category
cloudhas been outdated and it only can be used none I/O Optimized ECS instances. Recommendcloud_efficiencyandcloud_ssddisk.- Snapshot
Id string A snapshot to base the disk off of. If the disk size required by snapshot is greater than
size, thesizewill be ignored, conflict withencrypted.- Dictionary<string, object>
A mapping of tags to assign to the resource.
- Availability
Zone 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 iscloud_efficiency.- Delete
Auto boolSnapshot Indicates whether the automatic snapshot is deleted when the disk is released. Default value: false.
- Delete
With boolInstance 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.
- Enable
Auto boolSnapshot 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 stringId The ID of the KMS key corresponding to the data disk, The specified parameter
Encryptedmust betruewhen 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.
- Resource
Group stringId The Id of resource group which the disk belongs. > NOTE: Disk category
cloudhas been outdated and it only can be used none I/O Optimized ECS instances. Recommendcloud_efficiencyandcloud_ssddisk.- Snapshot
Id string A snapshot to base the disk off of. If the disk size required by snapshot is greater than
size, thesizewill be ignored, conflict withencrypted.- map[string]interface{}
A mapping of tags to assign to the resource.
- availability
Zone 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 iscloud_efficiency.- delete
Auto booleanSnapshot Indicates whether the automatic snapshot is deleted when the disk is released. Default value: false.
- delete
With booleanInstance 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.
- enable
Auto booleanSnapshot 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.- kms
Key stringId The ID of the KMS key corresponding to the data disk, The specified parameter
Encryptedmust betruewhen 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.
- resource
Group stringId The Id of resource group which the disk belongs. > NOTE: Disk category
cloudhas been outdated and it only can be used none I/O Optimized ECS instances. Recommendcloud_efficiencyandcloud_ssddisk.- snapshot
Id string A snapshot to base the disk off of. If the disk size required by snapshot is greater than
size, thesizewill be ignored, conflict withencrypted.- {[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 iscloud_efficiency.- delete_
auto_ boolsnapshot Indicates whether the automatic snapshot is deleted when the disk is released. Default value: false.
- delete_
with_ boolinstance 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_ boolsnapshot 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_ strid The ID of the KMS key corresponding to the data disk, The specified parameter
Encryptedmust betruewhen 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_ strid The Id of resource group which the disk belongs. > NOTE: Disk category
cloudhas been outdated and it only can be used none I/O Optimized ECS instances. Recommendcloud_efficiencyandcloud_ssddisk.- snapshot_
id str A snapshot to base the disk off of. If the disk size required by snapshot is greater than
size, thesizewill be ignored, conflict withencrypted.- 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:
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): Diskstatic 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);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:
- Availability
Zone 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 iscloud_efficiency.- Delete
Auto boolSnapshot Indicates whether the automatic snapshot is deleted when the disk is released. Default value: false.
- Delete
With boolInstance 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.
- Enable
Auto boolSnapshot 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 stringId The ID of the KMS key corresponding to the data disk, The specified parameter
Encryptedmust betruewhen 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.
- Resource
Group stringId The Id of resource group which the disk belongs. > NOTE: Disk category
cloudhas been outdated and it only can be used none I/O Optimized ECS instances. Recommendcloud_efficiencyandcloud_ssddisk.- 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.- Snapshot
Id string A snapshot to base the disk off of. If the disk size required by snapshot is greater than
size, thesizewill be ignored, conflict withencrypted.- Status string
The disk status.
- Dictionary<string, object>
A mapping of tags to assign to the resource.
- Availability
Zone 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 iscloud_efficiency.- Delete
Auto boolSnapshot Indicates whether the automatic snapshot is deleted when the disk is released. Default value: false.
- Delete
With boolInstance 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.
- Enable
Auto boolSnapshot 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 stringId The ID of the KMS key corresponding to the data disk, The specified parameter
Encryptedmust betruewhen 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.
- Resource
Group stringId The Id of resource group which the disk belongs. > NOTE: Disk category
cloudhas been outdated and it only can be used none I/O Optimized ECS instances. Recommendcloud_efficiencyandcloud_ssddisk.- 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.- Snapshot
Id string A snapshot to base the disk off of. If the disk size required by snapshot is greater than
size, thesizewill be ignored, conflict withencrypted.- Status string
The disk status.
- map[string]interface{}
A mapping of tags to assign to the resource.
- availability
Zone 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 iscloud_efficiency.- delete
Auto booleanSnapshot Indicates whether the automatic snapshot is deleted when the disk is released. Default value: false.
- delete
With booleanInstance 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.
- enable
Auto booleanSnapshot 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.- kms
Key stringId The ID of the KMS key corresponding to the data disk, The specified parameter
Encryptedmust betruewhen 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.
- resource
Group stringId The Id of resource group which the disk belongs. > NOTE: Disk category
cloudhas been outdated and it only can be used none I/O Optimized ECS instances. Recommendcloud_efficiencyandcloud_ssddisk.- 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.- snapshot
Id string A snapshot to base the disk off of. If the disk size required by snapshot is greater than
size, thesizewill be ignored, conflict withencrypted.- status string
The disk status.
- {[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 iscloud_efficiency.- delete_
auto_ boolsnapshot Indicates whether the automatic snapshot is deleted when the disk is released. Default value: false.
- delete_
with_ boolinstance 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_ boolsnapshot 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_ strid The ID of the KMS key corresponding to the data disk, The specified parameter
Encryptedmust betruewhen 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_ strid The Id of resource group which the disk belongs. > NOTE: Disk category
cloudhas been outdated and it only can be used none I/O Optimized ECS instances. Recommendcloud_efficiencyandcloud_ssddisk.- 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, thesizewill be ignored, conflict withencrypted.- status str
The disk status.
- 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
alicloudTerraform Provider.