ALIYUN::PAI::Workspace

ALIYUN::PAI::Workspace类型用于创建工作空间。

语法

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

属性

属性名称

类型

必须

允许更新

描述

约束

Description

String

工作空间描述。

不超过80个字符。

DisplayName

String

显示名称。

建议基于业务属性命名,便于标识工作空间用途。如果不配置,默认为工作空间名称。

格式如下:

  • 长度为3 ~ 23个字符,可以包含字母、下划线和数字。  

  • 必须以大写或小写字母开头。  

  • 当前区域唯一。 

WorkspaceName

String

工作空间名称。

格式如下:

  • 长度为3~23 个字符,可以包含字母、下划线或数字。

  • 必须以大小字母开头。

  • 当前地域内唯一。

EnvTypes

List

工作空间包含的环境。

取值:

  • 简单模式只有生产环境(prod)。

  • 标准模式包含开发环境(dev)和生产环境(prod)。

示例:

["dev", "prod"]

返回值

Fn::GetAtt

  • Owner:工作区所有者ID

  • Description:工作空间描述,不超过80个字符。

  • AdminNames:管理员账户名称列表。

  • DisplayName:显示名称。

  • WorkspaceId:工作空间ID。

  • WorkspaceName:工作空间名称

  • ExtraInfos:附加信息,当前包括TenantId(租户ID)。 

  • Creator:创建者的用户ID。

  • Users:用户列表。

  • EnvTypes:工作空间包含的环境

示例

YAML格式

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格式

{
  "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"
        ]
      }
    }
  }
}