ALIYUN::RAM::AttachPolicyToUser类型用于为指定用户添加权限。
语法
{
"Type": "ALIYUN::RAM::AttachPolicyToUser",
"Properties": {
"PolicyType": String,
"UserName": String,
"PolicyName": String
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
---|---|---|---|---|---|
PolicyType | String | 是 | 否 | 权限策略类型 | 取值:
|
UserName | String | 是 | 否 | 用户名 | 无 |
PolicyName | String | 是 | 否 | 权限策略名称 | 无 |
返回值
Fn::GetAtt
无。
示例
JSON
格式
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"PolicyType": {
"Type": "String",
"Description": "Authorization policy type. Value: \"System\" or \"Custom\".",
"AllowedValues": [
"System",
"Custom"
]
},
"UserName": {
"Type": "String",
"Description": "User name.Example: dev."
},
"PolicyName": {
"Type": "String",
"Description": "Authorization policy name."
}
},
"Resources": {
"AttachPolicyToUser": {
"Type": "ALIYUN::RAM::AttachPolicyToUser",
"Properties": {
"PolicyType": {
"Ref": "PolicyType"
},
"UserName": {
"Ref": "UserName"
},
"PolicyName": {
"Ref": "PolicyName"
}
}
}
}
}
YAML
格式
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
PolicyType:
Type: String
Description: 'Authorization policy type. Value: "System" or "Custom".'
AllowedValues:
- System
- Custom
UserName:
Type: String
Description: 'User name.Example: dev.'
PolicyName:
Type: String
Description: Authorization policy name.
Resources:
AttachPolicyToUser:
Type: 'ALIYUN::RAM::AttachPolicyToUser'
Properties:
PolicyType:
Ref: PolicyType
UserName:
Ref: UserName
PolicyName:
Ref: PolicyName