ALIYUN::RAM::AttachPolicyToGroup

更新时间:2025-02-12 01:39:21

ALIYUN::RAM::AttachPolicyToGroup类型用于指定用户组添加权限。

语法

{
  "Type": "ALIYUN::RAM::AttachPolicyToGroup",
  "Properties": {
    "GroupName": String,
    "PolicyType": String,
    "PolicyName": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

GroupName

String

指定用户组名称。

PolicyType

String

指定权限策略的类型。

取值为SystemCustom

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)
  • 语法
  • 属性
  • 返回值
  • 示例
AI助理

点击开启售前

在线咨询服务

你好,我是AI助理

可以解答问题、推荐解决方案等