All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ENS::DiskInstanceAttachment

Last Updated:Mar 25, 2024

ALIYUN::ENS::DiskInstanceAttachment is used to attach a data disk to an Edge Node Service (ENS) instance.

Syntax

{
  "Type": "ALIYUN::ENS::DiskInstanceAttachment",
  "Properties": {
    "InstanceId": String,
    "DeleteWithInstance": String,
    "DiskId": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

InstanceId

String

Yes

No

The instance ID.

None.

DeleteWithInstance

String

No

No

Specifies whether to release the disk when the instance is released.

Valid values:

  • true

  • false

  • If you leave this property empty, false is used by default.

DiskId

String

Yes

No

The disk ID.

The disk specified by DiskId and the instance specified by InstanceId must belong to the same node.

Return values

Fn::GetAtt

  • InstanceId: the instance ID.

  • DiskId: the disk ID.

Examples

  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      DeleteWithInstance:
        Description:
          en: "Whether the cloud disk to be mounted is released with the instance\nValue:\n\
            true: When the instance is released, the cloud disk is released together with\
            \ the instance.\nfalse: When the instance is released, the cloud disk is retained\
            \ and is not released together with the instance.\n Empty means false by default."
        Required: false
        Type: String
      DiskId:
        Description:
          en: The ID of the cloud disk to be mounted. The Cloud Disk (DiskId) and the
            instance (InstanceId) must be on the same node.
        Required: true
        Type: String
      InstanceId:
        Description:
          en: Instance ID.
        Required: true
        Type: String
    Resources:
      ExtensionResource:
        Properties:
          DeleteWithInstance:
            Ref: DeleteWithInstance
          DiskId:
            Ref: DiskId
          InstanceId:
            Ref: InstanceId
        Type: ALIYUN::ENS::DiskInstanceAttachment
    Outputs:
      DiskId:
        Description: The ID of the cloud disk to be mounted. The Cloud Disk (DiskId) and
          the instance (InstanceId) must be on the same node.
        Value:
          Fn::GetAtt:
          - ExtensionResource
          - DiskId
      InstanceId:
        Description: Instance ID.
        Value:
          Fn::GetAtt:
          - ExtensionResource
          - InstanceId                 
  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "InstanceId": {
          "Type": "String",
          "Description": {
            "en": "Instance ID."
          },
          "Required": true
        },
        "DeleteWithInstance": {
          "Type": "String",
          "Description": {
            "en": "Whether the cloud disk to be mounted is released with the instance\nValue:\ntrue: When the instance is released, the cloud disk is released together with the instance.\nfalse: When the instance is released, the cloud disk is retained and is not released together with the instance.\n Empty means false by default."
          },
          "Required": false
        },
        "DiskId": {
          "Type": "String",
          "Description": {
            "en": "The ID of the cloud disk to be mounted. The Cloud Disk (DiskId) and the instance (InstanceId) must be on the same node."
          },
          "Required": true
        }
      },
      "Resources": {
        "ExtensionResource": {
          "Type": "ALIYUN::ENS::DiskInstanceAttachment",
          "Properties": {
            "InstanceId": {
              "Ref": "InstanceId"
            },
            "DeleteWithInstance": {
              "Ref": "DeleteWithInstance"
            },
            "DiskId": {
              "Ref": "DiskId"
            }
          }
        }
      },
      "Outputs": {
        "InstanceId": {
          "Description": "Instance ID.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionResource",
              "InstanceId"
            ]
          }
        },
        "DiskId": {
          "Description": "The ID of the cloud disk to be mounted. The Cloud Disk (DiskId) and the instance (InstanceId) must be on the same node.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionResource",
              "DiskId"
            ]
          }
        }
      }
    }