All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::PAI::Workspace

Last Updated:Jul 03, 2023

ALIYUN::PAI::Workspace is used to create a workspace.

Syntax

{
  "Type": "ALIYUN::PAI::Workspace",
  "Properties": {
    "Description": String,
    "DisplayName": String,
    "WorkspaceName": String,
    "EnvTypes": List
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

Description

String

Yes

Yes

The description of the workspace.

The description can be up to 80 characters in length.

DisplayName

String

No

Yes

The display name of the workspace.

To distinguish the workspace, we recommend that you configure a display name for the workspace based on the purpose of the workspace. If you leave this property empty, the name of the workspace is used.

The name must meet the following format requirements:

  • It must be 3 to 23 characters in length, and can contain letters, underscores (_), and digits.  

  • It must start with a letter.  

  • It must be unique in the current region.  

WorkspaceName

String

Yes

No

The name of the workspace.

The name must meet the following format requirements:

  • It must be 3 to 23 characters in length, and can contain letters, underscores (_), and digits.

  • It must start with a letter.

  • It must be unique in the current region.

EnvTypes

List

Yes

No

The environments of the workspace.

Valid values: prod and dev. pro specifies the production environment. dev specifies the development environment.

  • Workspaces in basic mode can run only in the production environment.

  • Workspaces in standard mode can run in both the development and production environments.

Example:

["dev", "prod"]

Return values

Fn::GetAtt

  • Owner: the ID of the workspace owner.

  • Description: the description of the workspace. The description can be up to 80 characters in length.

  • AdminNames: the names of the administrator accounts.

  • DisplayName: the display name of the workspace.

  • WorkspaceId: the ID of the workspace.

  • WorkspaceName: the name of the workspace.

  • ExtraInfos: the additional information, including TenantId (tenant ID).  

  • Creator: the user ID of the creator.

  • Users: the users.

  • EnvTypes: the environments of the workspace.

Examples

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  DisplayName:
    AllowedPattern: ^[a-zA-Z][_a-zA-Z0-9]{2,22}$
    Description: 'It is recommended that you name the workspace based on the business
      attribute to identify the purpose of the workspace. If not configured, the default
      value is the workspace name. The format is as follows:

      - 3 to 23 characters in length and can contain letters, underscores, or numbers.

      - Must start with a large or small letter.

      - Unique in the current region.'
    Type: String
  EnvTypes:
    Description: 'Environments contained in the workspace:

      - Simple mode only production environment (prod).

      - Standard mode includes development environment (dev) and production environment
      (prod).'
    Type: Json
  WorkspaceName:
    AllowedPattern: ^[a-zA-Z][_a-zA-Z0-9]{2,22}$
    Description: 'The workspace name. The format is as follows:

      - 3 to 23 characters in length and can contain letters, underscores, or numbers.

      - Must start with a large or small letter.

      - Unique in the current region.'
    Type: String
Resources:
  ExtensionResource:
    Properties:
      DisplayName:
        Ref: DisplayName
      EnvTypes:
        Ref: EnvTypes
      WorkspaceName:
        Ref: WorkspaceName
    Type: ALIYUN::PAI::Workspace
Outputs:
  AdminNames:
    Description: List of administrator account names.
    Value:
      Fn::GetAtt:
      - ExtensionResource
      - AdminNames
  Creator:
    Description: The user ID of the creator.
    Value:
      Fn::GetAtt:
      - ExtensionResource
      - Creator
  Description:
    Description: Workspace description, no more than 80 characters.
    Value:
      Fn::GetAtt:
      - ExtensionResource
      - Description
  DisplayName:
    Description: It is recommended that you name the workspace based on the business
      attribute to identify the purpose of the workspace. If not configured, the default
      value is the workspace name.
    Value:
      Fn::GetAtt:
      - ExtensionResource
      - DisplayName
  EnvTypes:
    Description: Environments contained in the workspace:.
    Value:
      Fn::GetAtt:
      - ExtensionResource
      - EnvTypes
  ExtraInfos:
    Description: Additional information, currently including TenantId (tenant ID).
    Value:
      Fn::GetAtt:
      - ExtensionResource
      - ExtraInfos
  Owner:
    Description: Workspace owner ID, displayed when Verbose is true.
    Value:
      Fn::GetAtt:
      - ExtensionResource
      - Owner
  Users:
    Description: List of users.
    Value:
      Fn::GetAtt:
      - ExtensionResource
      - Users
  WorkspaceId:
    Description: The ID of the workspace.
    Value:
      Fn::GetAtt:
      - ExtensionResource
      - WorkspaceId
  WorkspaceName:
    Description: The workspace name.
    Value:
      Fn::GetAtt:
      - ExtensionResource
      - WorkspaceName

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "DisplayName": {
      "Type": "String",
      "Description": "It is recommended that you name the workspace based on the business attribute to identify the purpose of the workspace. If not configured, the default value is the workspace name. The format is as follows:\n- 3 to 23 characters in length and can contain letters, underscores, or numbers.\n- Must start with a large or small letter.\n- Unique in the current region.",
      "AllowedPattern": "^[a-zA-Z][_a-zA-Z0-9]{2,22}$"
    },
    "WorkspaceName": {
      "Type": "String",
      "Description": "The workspace name. The format is as follows:\n- 3 to 23 characters in length and can contain letters, underscores, or numbers.\n- Must start with a large or small letter.\n- Unique in the current region.",
      "AllowedPattern": "^[a-zA-Z][_a-zA-Z0-9]{2,22}$"
    },
    "EnvTypes": {
      "Type": "Json",
      "Description": "Environments contained in the workspace:\n- Simple mode only production environment (prod).\n- Standard mode includes development environment (dev) and production environment (prod)."
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::PAI::Workspace",
      "Properties": {
        "DisplayName": {
          "Ref": "DisplayName"
        },
        "WorkspaceName": {
          "Ref": "WorkspaceName"
        },
        "EnvTypes": {
          "Ref": "EnvTypes"
        }
      }
    }
  },
  "Outputs": {
    "Owner": {
      "Description": "Workspace owner ID, displayed when Verbose is true.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Owner"
        ]
      }
    },
    "Description": {
      "Description": "Workspace description, no more than 80 characters.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Description"
        ]
      }
    },
    "AdminNames": {
      "Description": "List of administrator account names.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "AdminNames"
        ]
      }
    },
    "DisplayName": {
      "Description": "It is recommended that you name the workspace based on the business attribute to identify the purpose of the workspace. If not configured, the default value is the workspace name.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "DisplayName"
        ]
      }
    },
    "WorkspaceId": {
      "Description": "The ID of the workspace.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "WorkspaceId"
        ]
      }
    },
    "WorkspaceName": {
      "Description": "The workspace name.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "WorkspaceName"
        ]
      }
    },
    "ExtraInfos": {
      "Description": "Additional information, currently including TenantId (tenant ID).",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ExtraInfos"
        ]
      }
    },
    "Creator": {
      "Description": "The user ID of the creator.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Creator"
        ]
      }
    },
    "Users": {
      "Description": "List of users.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Users"
        ]
      }
    },
    "EnvTypes": {
      "Description": "Environments contained in the workspace:.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "EnvTypes"
        ]
      }
    }
  }
}