All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::PAI::WorkspaceResourceMaxCompute

Last Updated:Dec 26, 2024

ALIYUN::PAI::WorkspaceResourceMaxCompute is used to associate MaxCompute resources with a workspace.

Syntax

{
  "Type": "ALIYUN::PAI::WorkspaceResourceMaxCompute",
  "Properties": {
    "GroupName": String,
    "Resources": List,
    "WorkspaceId": String,
    "IsDefault": Boolean,
    "Option": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

GroupName

String

Yes

No

The name of the resource group.

None.

Resources

List

Yes

No

The resources.

For more information, see Resources properties.

WorkspaceId

String

Yes

No

The workspace ID of the resources.

None.

IsDefault

Boolean

No

Yes

Specifies whether the resource is the default resource. Each type of resources has a default resource.

Valid values:

  • false (default)

  • true

Option

String

No

No

The option for creating resources.

Valid values:

  • CreateAndAttach: creates resources and associates them with a workspace.

  • Attach: associates resources with a workspace.

Resources syntax

"Resources": [
  {
    "WorkspaceResourceWorkspaceId": String,
    "Quotas": List,
    "WorkspaceResourceName": String,
    "Spec": Map,
    "EnvType": String
  }
]

Resources properties

Property

Type

Required

Editable

Description

Constraint

EnvType

String

Yes

No

The environment type.

Valid values:

  • dev: development environment

  • prod: production environment

WorkspaceResourceWorkspaceId

String

Yes

No

The workspace ID of the resource.

None.

WorkspaceResourceName

String

Yes

No

The resource name.

None.

Quotas

List

No

No

The resource quotas.

Note

Only MaxCompute resources support resource quotas.

Spec

Map

No

No

The specifications of the resource.

Example:

{
  "endpoint": "http://service.cn.maxcompute.aliyun-inc.com/api",
  "odpsProject": "workspace_resource_2"
}

Quotas syntax

"Quotas": [
  {
    "QuotaId": String
  }
]

Quotas property

Property

Type

Required

Editable

Description

Constraint

QuotaId

String

Yes

No

The ID of the resource quota.

None.

Return values

Fn::GetAtt

  • GroupName: the name of the resource group.

  • IsDefault: indicates whether the resource is the default resource.

  • CreateTime: the time when the resources were created.

  • Resources: the resources.

Examples

Note

The http://service.cn-shenzhen-vpc.maxcompute.aliyun-inc.com/api endpoint provided in this topic is the virtual private cloud (VPC) endpoint in the China (Shenzhen) region. If you want to access the endpoint in the China (Shenzhen) region over the Internet, replace the value of the endpoint property with http://service.cn-shenzhen.maxcompute.aliyun.com/api. For more information about endpoints in other regions, see Endpoints.

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters: {}
Resources:
  ExtensionResource:
    Type: ALIYUN::PAI::WorkspaceResourceMaxCompute
    Properties:
      GroupName: group_mc_7f0c3040-cfcb-11ee-8fd8-f3175b****
      WorkspaceId: 611**
      Option: Attach
      Resources:
        - WorkspaceResourceName: workspace_resource_2
          WorkspaceResourceWorkspaceId: 611**
          EnvType: prod
          Spec:
            endpoint: http://service.cn.maxcompute.aliyun-inc.com/api
            odpsProject: workspace_resource_2
          Quotas: []
Outputs:
  GroupName:
    Description: Resource group name. If you want to obtain a resource group name, see [ListResources](~~ 449143 ~~).
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - GroupName
  IsDefault:
    Description: Indicates whether it is the default resource. Currently, this parameter only supports the input of true and does not support false.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - IsDefault
  CreateTime:
    Description: The creation time of the resource.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CreateTime
  Resources:
    Description: Resource List.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Resources

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {},
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::PAI::WorkspaceResourceMaxCompute",
      "Properties": {
        "GroupName": "group_mc_7f0c3040-cfcb-11ee-8fd8-f3175b****",
        "WorkspaceId": "611**",
        "Option": "Attach",
        "Resources": [
          {
            "WorkspaceResourceName": "workspace_resource_2",
            "WorkspaceResourceWorkspaceId": "611**",
            "EnvType": "prod",
            "Spec": {
              "endpoint": "http://service.cn.maxcompute.aliyun-inc.com/api",
              "odpsProject": "workspace_resource_2"
            },
            "Quotas": []
          }
        ]
      }
    }
  },
  "Outputs": {
    "GroupName": {
      "Description": "Resource group name. If you want to obtain a resource group name, see [ListResources](~~ 449143 ~~).",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "GroupName"
        ]
      }
    },
    "IsDefault": {
      "Description": "Indicates whether it is the default resource. Currently, this parameter only supports the input of true and does not support false.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "IsDefault"
        ]
      }
    },
    "CreateTime": {
      "Description": "The creation time of the resource.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CreateTime"
        ]
      }
    },
    "Resources": {
      "Description": "Resource List.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Resources"
        ]
      }
    }
  }
}