All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::PAI::WorkspaceResourceMaxCompute

Last Updated:Aug 13, 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 one. 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": "odps.alibaba-inc.com", "Project": "mignshi"}

Quotas syntax

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

Quotas properties

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 one.

  • CreateTime: the time when the resources were created.

  • Resources: the resources.

Examples

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters: {}
Resources:
  ExtensionResource:
    Type: ALIYUN::PAI::WorkspaceResourceMaxCompute
    Properties:
      GroupName: group_mc_7f0c3040-cfcb-11ee-8fd8-f3175b454b61
      WorkspaceId: '61163'
      Option: Attach
      Resources:
        - WorkspaceResourceName: workspace_resource_2
          WorkspaceResourceWorkspaceId: '61163'
          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-f3175b454b61",
        "WorkspaceId": "61163",
        "Option": "Attach",
        "Resources": [
          {
            "WorkspaceResourceName": "workspace_resource_2",
            "WorkspaceResourceWorkspaceId": "61163",
            "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"
        ]
      }
    }
  }
}