全部产品
Search
文档中心

资源编排:ALIYUN::MaxCompute::Role

更新时间:Dec 05, 2024

ALIYUN::MaxCompute::Role类型用于创建MaxCompute项目级角色。

语法

{
  "Type": "ALIYUN::MaxCompute::Role",
  "Properties": {
    "ProjectName": String,
    "RoleName": String,
    "Type": String,
    "Acl": Map,
    "Policy": Map
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

ProjectName

String

MaxCompute 项目名称。

RoleName

String

角色名称。

Type

String

角色类型。

枚举值:

  • Resource:resource。

  • Admin:admin。

Acl

Map

角色的 ACL 授权信息。

更多信息,请参见Acl属性

Policy

Map

角色的 Policy 授权信息

Acl语法

"Acl": {
  "Function": List,
  "Project": List,
  "Table": List,
  "Instance": List,
  "Resource": List,
  "Package": List
}

Acl属性

属性名称

类型

必须

允许更新

描述

约束

Function

List

函数集合。

Instance

List

实例集合。

Project

List

项目集合。

Package

List

Package集合。

Resource

List

资源集合。

Table

List

表集合。

Function语法

"Function": [
  {
    "Actions": List,
    "Name": String
  }
]

Function属性

属性名称

类型

必须

允许更新

描述

约束

Name

String

函数名称。

Actions

List

函数操作

取值:

  • All

  • Read

  • Write

  • Download

  • Execute

  • Delete

Project语法

"Project": [
  {
    "Actions": List,
    "Name": String
  }
]

Project属性

属性名称

类型

必须

允许更新

描述

约束

Name

String

MaxCompute 项目名称。

Actions

List

项目操作

取值:

  • All

  • Read

  • Write

  • List

  • CreateTable

  • CreateInstance

Table语法

"Table": [
  {
    "Actions": List,
    "Name": String
  }
]

Table属性

属性名称

类型

必须

允许更新

描述

约束

Name

String

表名称。

Actions

List

表操作

取值:

  • All

  • Describe

  • Select

  • Update

  • Alter

  • Drop

  • ShowHistory

  • Download

Instance语法

"Instance": [
  {
    "Actions": List,
    "Name": String
  }
]

Instance属性

属性名称

类型

必须

允许更新

描述

约束

Name

String

实例名称。

Actions

List

实例操作。

Resource语法

"Resource": [
  {
    "Actions": List,
    "Name": String
  }
]

Resource属性

属性名称

类型

必须

允许更新

描述

约束

Name

String

资源名称。

Actions

List

资源操作

取值:

  • All

  • Read

  • Write

  • Download

  • Delete

Package语法

"Package": [
  {
    "Actions": List,
    "Name": String
  }
]

Package属性

属性名称

类型

必须

允许更新

描述

约束

Name

String

Package 名称。

Actions

List

Package 操作。

取值:

  • Read

返回值

Fn::GetAtt

  • RoleName:角色名称。

  • ProjectName:Maxcompute 项目名称

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  RoleName:
    Type: String
    Description:
      en: The name of the project role
    Required: true
  Type:
    Type: String
    Description:
      en: |-
        Role types, MaxCompute provides administrator roles and resource roles. Valid values:
        Admin: You can grant management-related permissions to administrator roles by using policies instead of access control lists (ACLs). You cannot grant resource-related permissions to administrator roles.
        Resource: You can grant resource-related permissions but not management-related permissions to resource roles.
    AllowedValues:
      - Admin
      - Resource
    Required: true
  ProjectName:
    Type: String
    Description:
      en: The name of the MaxCompute project.
    Required: true
Resources:
  ExtensionResource:
    Type: ALIYUN::MaxCompute::Role
    Properties:
      RoleName:
        Ref: RoleName
      Type:
        Ref: Type
      ProjectName:
        Ref: ProjectName
Outputs:
  RoleName:
    Description: The name of the project role.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RoleName
  ProjectName:
    Description: The name of the MaxCompute project.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ProjectName
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "RoleName": {
      "Type": "String",
      "Description": {
        "en": "The name of the project role"
      },
      "Required": true
    },
    "Type": {
      "Type": "String",
      "Description": {
        "en": "Role types, MaxCompute provides administrator roles and resource roles. Valid values:\nAdmin: You can grant management-related permissions to administrator roles by using policies instead of access control lists (ACLs). You cannot grant resource-related permissions to administrator roles.\nResource: You can grant resource-related permissions but not management-related permissions to resource roles."
      },
      "AllowedValues": [
        "Admin",
        "Resource"
      ],
      "Required": true
    },
    "ProjectName": {
      "Type": "String",
      "Description": {
        "en": "The name of the MaxCompute project."
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::MaxCompute::Role",
      "Properties": {
        "RoleName": {
          "Ref": "RoleName"
        },
        "Type": {
          "Ref": "Type"
        },
        "ProjectName": {
          "Ref": "ProjectName"
        }
      }
    }
  },
  "Outputs": {
    "RoleName": {
      "Description": "The name of the project role.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RoleName"
        ]
      }
    },
    "ProjectName": {
      "Description": "The name of the MaxCompute project.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ProjectName"
        ]
      }
    }
  }
}