All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::PaiDswApi::Instance

Last Updated:Nov 20, 2023

ALIYUN::PaiDswApi::Instance is used to create a Data Science Workshop (DSW) instance.

Syntax

{
  "Type": "ALIYUN::PaiDswApi::Instance",
  "Properties": {
    "Datasets": List,
    "InstanceName": String,
    "EnvironmentVariables": Map,
    "Accessibility": String,
    "WorkspaceId": String,
    "ImageUrl": String,
    "EcsSpec": String,
    "Labels": List,
    "SaveImage": Boolean,
    "UserVpc": Map
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

Datasets

List

No

Yes

The collection of the datasets.

None.

InstanceName

String

Yes

Yes

The instance name.

  • The name can contain only letters, digits, and underscores (_).

  • The name can be up to 27 characters in length.

EnvironmentVariables

Map

No

No

The environment variables.

None.

Accessibility

String

No

Yes

The accessibility of the workspace.

Valid values:

  • PRIVATE: The workspace can be accessed only by the administrator.

  • PUBLIC: The workspace can be accessed by all users.

WorkspaceId

String

No

No

The workspace ID.

None.

ImageUrl

String

Yes

Yes

The image URL.

None.

EcsSpec

String

Yes

Yes

The Elastic Compute Service (ECS) instance type.

None.

Labels

List

No

No

The custom tag.

None.

SaveImage

Boolean

No

No

Specifies whether to shut down the instance after the environment is saved.

Valid values:

  • true

  • false

UserVpc

Map

No

No

The virtual private cloud (VPC) configurations.

None.

Datasets syntax

"Datasets": [
  {
    "MountPath": String,
    "DatasetId": String
  }
]

Datasets properties

Property

Type

Required

Editable

Description

Constraint

MountPath

String

No

Yes

The mount path in the container.

None.

DatasetId

String

No

Yes

The dataset ID.

None.

Labels syntax

"Labels": [
  {
    "Value": String,
    "Key": String
  }
]

Labels properties

Property

Type

Required

Editable

Description

Constraint

Value

String

No

No

The label value.

The label value can be up to 128 characters in length, and cannot contain http:// or https://. The label value cannot start with aliyun or acs:.

Key

String

No

No

The label key.

The label key must be 1 to 128 characters in length, and cannot contain http:// or https://. The label key cannot start with aliyun or acs:.

UserVpc syntax

"UserVpc": {
  "VpcId": String,
  "SecurityGroupId": String
}

UserVpc properties

Property

Type

Required

Editable

Description

Constraint

VpcId

String

No

Yes

The VPC ID.

None.

SecurityGroupId

String

No

Yes

The ID of the security group.

None.

Return values

Fn::GetAtt

  • Datasets: the collection of the datasets.

  • InstanceName: the instance name.

  • EnvironmentVariables: the environment variables.

  • Accessibility: the accessibility of the workspace.

  • InstanceId: the instance ID.

  • WorkspaceIds: the workspace ID.

  • ImageUrl: the image URL.

  • PaymentType: the billing method.

  • EcsSpec: the ECS instance type.

  • Labels: the custom tags of the instance.

  • UserVpc: the VPC configurations.

  • JupyterlabUrl: the Jupyterlab URL.

  • TerminalUrl: the terminal URL.

  • InstanceUrl: the instance URL.

  • WebIDEUrl: the Web IDE URL.

Examples

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  EcsSpec:
    Description: The ECS specification of the instance.
    Type: String
    Default: ecs.gn5-c28g1.7xlarge
  ImageUrl:
    Description: The mirror address.
    Type: String
    Default: registry-vpc.cn-shanghai.aliyuncs.com/******/pai:python_3.8.10-tensorflow_2.9.0
  InstanceName:
    AllowedPattern: ^[_a-zA-Z0-9]{1,27}$
    Description: 'The instance name. Format requirements:

      - Can only contain letters, numbers and underscores (_).

      - It cannot exceed 27 characters.'
    Type: String
Resources:
  ExtensionResource:
    Properties:
      EcsSpec:
        Ref: EcsSpec
      ImageUrl:
        Ref: ImageUrl
      InstanceName:
        Ref: InstanceName
    Type: ALIYUN::PaiDswApi::Instance
Outputs:
  Accessibility:
    Description: Whether the workspace is visible to others.
    Value:
      Fn::GetAtt:
      - ExtensionResource
      - Accessibility
  Datasets:
    Description: A collection of datasets.
    Value:
      Fn::GetAtt:
      - ExtensionResource
      - Datasets
  EcsSpec:
    Description: The ECS specification of the instance.
    Value:
      Fn::GetAtt:
      - ExtensionResource
      - EcsSpec
  EnvironmentVariables:
    Description: Environment variable.
    Value:
      Fn::GetAtt:
      - ExtensionResource
      - EnvironmentVariables
  ImageUrl:
    Description: The mirror address.
    Value:
      Fn::GetAtt:
      - ExtensionResource
      - ImageUrl
  InstanceId:
    Description: The first ID of the resource.
    Value:
      Fn::GetAtt:
      - ExtensionResource
      - InstanceId
  InstanceName:
    Description: The instance name.
    Value:
      Fn::GetAtt:
      - ExtensionResource
      - InstanceName
  Labels:
    Description: User-defined labels.
    Value:
      Fn::GetAtt:
      - ExtensionResource
      - Labels
  PaymentType:
    Description: The payment type of the resource.
    Value:
      Fn::GetAtt:
      - ExtensionResource
      - PaymentType
  UserVpc:
    Description: User vpc configuration.
    Value:
      Fn::GetAtt:
      - ExtensionResource
      - UserVpc
  WorkspaceId:
    Description: The Id of the workspace.
    Value:
      Fn::GetAtt:
      - ExtensionResource
      - WorkspaceId

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "EcsSpec": {
      "Description": "The ECS specification of the instance.",
      "Type": "String",
      "Default": "ecs.gn5-c28g1.7xlarge"
    },
    "ImageUrl": {
      "Description": "The mirror address.",
      "Type": "String",
      "Default": "registry-vpc.cn-shanghai.aliyuncs.com/******/pai:python_3.8.10-tensorflow_2.9.0"
    },
    "InstanceName": {
      "AllowedPattern": "^[_a-zA-Z0-9]{1,27}$",
      "Description": "The instance name. Format requirements:\n- Can only contain letters, numbers and underscores (_).\n- It cannot exceed 27 characters.",
      "Type": "String"
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Properties": {
        "EcsSpec": {
          "Ref": "EcsSpec"
        },
        "ImageUrl": {
          "Ref": "ImageUrl"
        },
        "InstanceName": {
          "Ref": "InstanceName"
        }
      },
      "Type": "ALIYUN::PaiDswApi::Instance"
    }
  },
  "Outputs": {
    "Accessibility": {
      "Description": "Whether the workspace is visible to others.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Accessibility"
        ]
      }
    },
    "Datasets": {
      "Description": "A collection of datasets.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Datasets"
        ]
      }
    },
    "EcsSpec": {
      "Description": "The ECS specification of the instance.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "EcsSpec"
        ]
      }
    },
    "EnvironmentVariables": {
      "Description": "Environment variable.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "EnvironmentVariables"
        ]
      }
    },
    "ImageUrl": {
      "Description": "The mirror address.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ImageUrl"
        ]
      }
    },
    "InstanceId": {
      "Description": "The first ID of the resource.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "InstanceId"
        ]
      }
    },
    "InstanceName": {
      "Description": "The instance name.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "InstanceName"
        ]
      }
    },
    "Labels": {
      "Description": "User-defined labels.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Labels"
        ]
      }
    },
    "PaymentType": {
      "Description": "The payment type of the resource.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "PaymentType"
        ]
      }
    },
    "UserVpc": {
      "Description": "User vpc configuration.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "UserVpc"
        ]
      }
    },
    "WorkspaceId": {
      "Description": "The Id of the workspace.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "WorkspaceId"
        ]
      }
    }
  }
}