ALIYUN::RAM::AttachPolicyToUser类型用于为指定用户添加权限。

语法

{
  "Type": "ALIYUN::RAM::AttachPolicyToUser",
  "Properties": {
    "PolicyType": String,
    "UserName": String,
    "PolicyName": String
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
PolicyType String 权限策略类型 取值:
  • System
  • Custom
UserName String 用户名
PolicyName String 权限策略名称

返回值

Fn::GetAtt

无。

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters: {}
    Resources:
      AttachPolicyToUser:
        Type: ALIYUN::RAM::AttachPolicyToUser
        Properties:
          PolicyType: Custom
          UserName: dev
          PolicyName: TestPolicy
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
      },
      "Resources": {
        "AttachPolicyToUser": {
          "Type": "ALIYUN::RAM::AttachPolicyToUser",
          "Properties": {
            "PolicyType": "Custom",
            "UserName": "dev",
            "PolicyName": "TestPolicy"
          }
        }
      }
    }