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 | 是 | 否 | 角色类型。 | 枚举值: 
 | 
| 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 | 否 | 否 | 函数操作 | 取值: 
 | 
Project语法
"Project": [
  {
    "Actions": List,
    "Name": String
  }
]Project属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| Name | String | 是 | 否 | MaxCompute 项目名称。 | 无 | 
| Actions | List | 否 | 否 | 项目操作 | 取值: 
 | 
Table语法
"Table": [
  {
    "Actions": List,
    "Name": String
  }
]Table属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| Name | String | 是 | 否 | 表名称。 | 无 | 
| Actions | List | 否 | 否 | 表操作 | 取值: 
 | 
Instance语法
"Instance": [
  {
    "Actions": List,
    "Name": String
  }
]Instance属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| Name | String | 是 | 否 | 实例名称。 | 无 | 
| Actions | List | 否 | 否 | 实例操作。 | 无 | 
Resource语法
"Resource": [
  {
    "Actions": List,
    "Name": String
  }
]Resource属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| Name | String | 是 | 否 | 资源名称。 | 无 | 
| Actions | List | 否 | 否 | 资源操作 | 取值: 
 | 
Package语法
"Package": [
  {
    "Actions": List,
    "Name": String
  }
]Package属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| Name | String | 是 | 否 | Package 名称。 | 无 | 
| Actions | List | 否 | 否 | Package 操作。 | 取值: 
 | 
返回值
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"
        ]
      }
    }
  }
}