ALIYUN::RAM::AttachPolicyToGroup类型用于指定用户组添加权限。
语法
{
"Type": "ALIYUN::RAM::AttachPolicyToGroup",
"Properties": {
"GroupName": String,
"PolicyType": String,
"PolicyName": String
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
GroupName | String | 是 | 否 | 指定用户组名称。 | 无 |
PolicyType | String | 是 | 否 | 指定权限策略的类型。 | 取值为 |
PolicyName | String | 是 | 否 | 指定权限策略名称。 | 无 |
返回值
Fn::GetAtt
GroupName:用户组名称。
PolicyName:权限策略名称。
示例
YAML
JSON
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
GroupName:
Type: String
Description:
en: User group name.
Required: true
PolicyType:
Type: String
Description:
en: 'Authorization policy type. Value: "System" or "Custom".'
AllowedValues:
- Custom
- System
Required: true
PolicyName:
Type: String
Description:
en: Authorization policy name.
Required: true
Resources:
AttachPolicyToGroup:
Type: ALIYUN::RAM::AttachPolicyToGroup
Properties:
GroupName:
Ref: GroupName
PolicyType:
Ref: PolicyType
PolicyName:
Ref: PolicyName
Outputs:
GroupName:
Description: User group name.
Value:
Fn::GetAtt:
- AttachPolicyToGroup
- GroupName
PolicyName:
Description: Authorization policy name.
Value:
Fn::GetAtt:
- AttachPolicyToGroup
- PolicyName
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"GroupName": {
"Type": "String",
"Description": {
"en": "User group name."
},
"Required": true
},
"PolicyType": {
"Type": "String",
"Description": {
"en": "Authorization policy type. Value: \"System\" or \"Custom\"."
},
"AllowedValues": [
"Custom",
"System"
],
"Required": true
},
"PolicyName": {
"Type": "String",
"Description": {
"en": "Authorization policy name."
},
"Required": true
}
},
"Resources": {
"AttachPolicyToGroup": {
"Type": "ALIYUN::RAM::AttachPolicyToGroup",
"Properties": {
"GroupName": {
"Ref": "GroupName"
},
"PolicyType": {
"Ref": "PolicyType"
},
"PolicyName": {
"Ref": "PolicyName"
}
}
}
},
"Outputs": {
"GroupName": {
"Description": "User group name.",
"Value": {
"Fn::GetAtt": [
"AttachPolicyToGroup",
"GroupName"
]
}
},
"PolicyName": {
"Description": "Authorization policy name.",
"Value": {
"Fn::GetAtt": [
"AttachPolicyToGroup",
"PolicyName"
]
}
}
}
}
该文章对您有帮助吗?
- 本页导读 (1)
- 语法
- 属性
- 返回值
- 示例