ALIYUN::RAM::Group类型用于创建RAM用户组。
语法
{
"Type": "ALIYUN::RAM::Group",
"Properties": {
"GroupName": String,
"Comments": String,
"Policies": List,
"PolicyAttachments": Map,
"DeletionForce": Boolean
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
---|---|---|---|---|---|
GroupName | String | 是 | 否 | 用户组名称。 | 长度为1~64个字符,可包含英文字母、数字和短划线(-)。 |
Comments | String | 否 | 否 | 备注信息。 | 长度为1~128个字符。 |
Policies | List | 否 | 是 | 权限策略。 | 更多信息,请参见Policies属性。 |
PolicyAttachments | Map | 否 | 是 | 要添加的系统和自定义策略名称。 | 更多信息,请参见PolicyAttachments属性。 |
DeletionForce | Boolean | 否 | 是 | 是否强制解绑RAM用户组的策略。 | 取值:
|
Policies语法
"Policies": [
{
"Description": String,
"PolicyName": String,
"PolicyDocument": Map
}
]
Policies属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
---|---|---|---|---|---|
Description | String | 否 | 否 | 描述。 | 长度为1~1024个字符。 |
PolicyName | String | 是 | 否 | 权限策略名称。 | 长度为1~128个字符,可包含英文字母、数字和短划线(-)。 |
PolicyDocument | Map | 是 | 是 | 权限策略内容。 | 长度不超过2048个字符。
关于权限策略元素和示例,请参见权限策略基本元素和权限策略示例库。 更多信息,请参见PolicyDocument属性。 |
PolicyDocument语法
"PolicyDocument": {
"Version": String,
"Statement": List
}
PolicyDocument属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
---|---|---|---|---|---|
Version | String | 否 | 否 | 权限策略版本。 | 无 |
Statement | List | 否 | 否 | 权限策略规则。 | 更多信息,请参见Statement属性。 |
Statement语法
"Statement": [
{
"Condition": Map,
"Action": List,
"Resource": List,
"Effect": String
}
]
Statement属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
---|---|---|---|---|---|
Condition | Map | 否 | 否 | 授权生效的限制条件。 | 无 |
Action | List | 否 | 否 | 权限策略针对的具体操作。 | 无 |
Resource | List | 否 | 否 | 权限策略针对的具体资源。 | 无 |
Effect | String | 否 | 否 | 授权效力。 | 取值:
|
PolicyAttachments语法
"PolicyAttachments": {
"System": List,
"Custom": List
}
PolicyAttachments属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
---|---|---|---|---|---|
Custom | List | 否 | 是 | 自定义策略名称列表。 | 策略数量小于等于5。 |
System | List | 否 | 是 | 系统策略名称列表。 | 策略数量小于等于20。 |
返回值
Fn::GetAtt
GroupName:RAM用户组名称。
示例
JSON
格式
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"GroupName": {
"Type": "String",
"Description": "Specifies the group name, containing up to 64 characters."
},
"Policies": {
"Type": "Json",
"Description": "Describes what actions are allowed on what resources."
},
"Comments": {
"Type": "String",
"Description": "Remark information, up to 128 characters or Chinese characters.",
"MaxLength": 128
}
},
"Resources": {
"Group": {
"Type": "ALIYUN::RAM::Group",
"Properties": {
"GroupName": {
"Ref": "GroupName"
},
"Policies": {
"Ref": "Policies"
},
"Comments": {
"Ref": "Comments"
}
}
}
},
"Outputs": {
"GroupName": {
"Description": "Id of ram group.",
"Value": {
"Fn::GetAtt": [
"Group",
"GroupName"
]
}
}
}
}
YAML
格式
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
GroupName:
Type: String
Description: 'Specifies the group name, containing up to 64 characters.'
Policies:
Type: Json
Description: Describes what actions are allowed on what resources.
Comments:
Type: String
Description: 'Remark information, up to 128 characters or Chinese characters.'
MaxLength: 128
Resources:
Group:
Type: 'ALIYUN::RAM::Group'
Properties:
GroupName:
Ref: GroupName
Policies:
Ref: Policies
Comments:
Ref: Comments
Outputs:
GroupName:
Description: Id of ram group.
Value:
'Fn::GetAtt':
- Group
- GroupName
更多示例,请参见创建RAM用户、创建RAM用户组、为指定RAM用户添加权限和添加RAM用户到用户组的组合示例:JSON示例和YAML示例。