Tous les produits
Search
Centre de documentation

Resource Orchestration Service:ALIYUN::RAM::Group

Dernière mise à jour :Aug 10, 2026

ALIYUN::RAM::Group crée un groupe d'utilisateurs Resource Access Management (RAM).

Syntaxe

{
  "Type": "ALIYUN::RAM::Group",
  "Properties": {
    "GroupName": String,
    "Comments": String,
    "Policies": List,
    "PolicyAttachments": Map,
    "DeletionForce": Boolean,
    "IgnoreExisting": Boolean
  }
}

Propriétés

Propriété

Type

Obligatoire

Modifiable

Description

Contraintes

GroupName

String

Oui

Non

Nom du groupe d'utilisateurs.

Le nom doit comporter entre 1 et 64 caractères et peut contenir des lettres, des chiffres et des traits d'union (-).

Comments

String

Non

Oui

Remarques

La valeur doit comporter entre 1 et 128 caractères.

DeletionForce

Boolean

Non

Oui

Indique s'il faut détacher de force les stratégies du groupe d'utilisateurs RAM.

Valeurs valides :

  • true : Détache les stratégies de force.

  • false (par défaut) : Ne détache pas les stratégies de force.

IgnoreExisting

Boolean

Non

Non

Indique s'il faut ignorer les groupes existants.

Valeurs valides :

  • true : Resource Orchestration Service (ROS) ne vérifie pas l'unicité. Si un groupe portant le même nom existe, la création du groupe est ignorée. Si le groupe n'a pas été créé par ROS, il est ignoré lors des phases de mise à jour et de suppression.

  • false : ROS effectue une vérification d'unicité. Si un groupe portant le même nom existe, une erreur est signalée lors de la création.

Policies

List

Non

Oui

Stratégies d'accès.

Pour plus d'informations, consultez Propriétés Policies.

PolicyAttachments

Map

Non

Oui

Noms des stratégies système et personnalisées à attacher.

Pour plus d'informations, consultez Propriétés PolicyAttachments.

Syntaxe Policies

"Policies": [
  {
    "Description": String,
    "PolicyName": String,
    "PolicyDocument": Map,
    "IgnoreExisting": Boolean
  }
]

Propriétés Policies

Propriété

Type

Obligatoire

Modifiable

Description

Contraintes

PolicyDocument

Map

Oui

Oui

Document de stratégie.

Le document peut contenir jusqu'à 2 048 caractères.

Pour obtenir des informations sur les éléments et des exemples de stratégie d'accès, consultez Éléments de base d'une stratégie d'accès et Présentation de la bibliothèque d'exemples de stratégies d'accès.

Pour plus d'informations, consultez Propriétés PolicyDocument.

PolicyName

String

Oui

Non

Nom de la stratégie d'accès.

Le nom doit comporter entre 1 et 128 caractères et peut contenir des lettres, des chiffres et des traits d'union (-).

Description

String

Non

Non

Description.

La description doit comporter entre 1 et 1 024 caractères.

IgnoreExisting

Boolean

Non

Non

Indique s'il faut ignorer les stratégies existantes.

Valeurs valides :

  • true : ROS ne vérifie pas l'unicité. Si une stratégie portant le même nom existe, la création de la stratégie est ignorée. Si la stratégie n'a pas été créée par ROS, elle est ignorée lors des phases de mise à jour et de suppression.

  • false : ROS effectue une vérification d'unicité. Si une stratégie portant le même nom existe, une erreur est signalée lors de la création.

Syntaxe PolicyDocument

"PolicyDocument": {
  "Version": String,
  "Statement": List
}

Propriétés PolicyDocument

Propriété

Type

Obligatoire

Modifiable

Description

Contraintes

Statement

List

Oui

Non

Règles de la stratégie d'accès.

Pour plus d'informations, consultez Propriétés Statement.

Version

String

Oui

Non

Version de la stratégie d'accès.

Aucune

Syntaxe Statement

"Statement": [
  {
    "Condition": Map,
    "Action": List,
    "Resource": List,
    "Effect": String,
    "NotAction": List
  }
]

Propriétés Statement

Propriété

Type

Obligatoire

Modifiable

Description

Contraintes

Action

List

Non

Non

Opérations auxquelles s'applique la stratégie d'accès.

Aucune

Condition

Map

Non

Non

Conditions dans lesquelles l'autorisation prend effet.

Aucune

Effect

String

Non

Non

Effet de l'autorisation.

Valeurs valides :

  • Allow : L'action est autorisée.

  • Deny : La demande est rejetée.

NotAction

List

Non

Non

Opérations spécifiées exclues lorsque Allow ou Deny prend effet.

Aucune

Resource

List

Non

Non

Ressources auxquelles s'applique la stratégie d'accès.

Aucune

Syntaxe PolicyAttachments

"PolicyAttachments": {
  "System": List,
  "Custom": List
}

Propriétés PolicyAttachments

Propriété

Type

Obligatoire

Modifiable

Description

Contraintes

Custom

List

Non

Oui

Liste de noms de stratégies personnalisées.

Le nombre maximal de stratégies est de 5.

System

List

Non

Oui

Liste de noms de stratégies système.

Le nombre maximal de stratégies est de 20.

Valeurs de retour

Fn::GetAtt

  • GroupName : Nom du groupe d'utilisateurs RAM.

Exemples

Scénario 1 : Créer un groupe RAM avec des stratégies système pour un contrôle d'accès en lecture seule pour l'équipe.

ROSTemplateFormatVersion: '2015-09-01'
Description:
  zh-cn: 创建RAM用户组并附加系统权限策略,实现团队只读访问控制。
  en: Create a RAM group with system policies for team read-only access control.
Parameters:
  GroupName:
    Type: String
    Label:
      zh-cn: 用户组名称
      en: Group Name
    Description:
      zh-cn: >-
        RAM用户组名称,1~64个字符,
        可包含英文字母、数字和短横线。
      en: >-
        RAM group name, 1-64 characters,
        may contain letters, digits and hyphens.
    Default: readonly-team
  Comments:
    Type: String
    Label:
      zh-cn: 用户组备注
      en: Group Comments
    Description:
      zh-cn: 用户组的备注说明,1~128个字符。
      en: Comments for the group, 1-128 characters.
    Default: 只读访问权限组,用于运维巡检和审计
    MaxLength: 128
Resources:
  Group:
    Type: ALIYUN::RAM::Group
    Properties:
      GroupName:
        Ref: GroupName
      Comments:
        Ref: Comments
      PolicyAttachments:
        System:
          - AliyunECSReadOnlyAccess
          - AliyunOSSReadOnlyAccess
          - AliyunRDSReadOnlyAccess
          - AliyunVPCReadOnlyAccess
Outputs:
  GroupName:
    Label:
      zh-cn: 用户组名称
      en: Group Name
    Description:
      zh-cn: 创建成功的RAM用户组名称。
      en: The name of the created RAM group.
    Value:
      Fn::GetAtt:
        - Group
        - GroupName
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
    "zh-cn": "创建RAM用户组并附加系统权限策略,实现团队只读访问控制。",
    "en": "Create a RAM group with system policies for team read-only access control."
  },
  "Parameters": {
    "GroupName": {
      "Type": "String",
      "Label": {
        "zh-cn": "用户组名称",
        "en": "Group Name"
      },
      "Description": {
        "zh-cn": "RAM用户组名称,1~64个字符,可包含英文字母、数字和短横线。",
        "en": "RAM group name, 1-64 characters, may contain letters, digits and hyphens."
      },
      "Default": "readonly-team"
    },
    "Comments": {
      "Type": "String",
      "Label": {
        "zh-cn": "用户组备注",
        "en": "Group Comments"
      },
      "Description": {
        "zh-cn": "用户组的备注说明,1~128个字符。",
        "en": "Comments for the group, 1-128 characters."
      },
      "Default": "只读访问权限组,用于运维巡检和审计",
      "MaxLength": 128
    }
  },
  "Resources": {
    "Group": {
      "Type": "ALIYUN::RAM::Group",
      "Properties": {
        "GroupName": {
          "Ref": "GroupName"
        },
        "Comments": {
          "Ref": "Comments"
        },
        "PolicyAttachments": {
          "System": [
            "AliyunECSReadOnlyAccess",
            "AliyunOSSReadOnlyAccess",
            "AliyunRDSReadOnlyAccess",
            "AliyunVPCReadOnlyAccess"
          ]
        }
      }
    }
  },
  "Outputs": {
    "GroupName": {
      "Label": {
        "zh-cn": "用户组名称",
        "en": "Group Name"
      },
      "Description": {
        "zh-cn": "创建成功的RAM用户组名称。",
        "en": "The name of the created RAM group."
      },
      "Value": {
        "Fn::GetAtt": [
          "Group",
          "GroupName"
        ]
      }
    }
  }
}

Scénario 2 : Créer un groupe RAM avec des stratégies personnalisées inline pour un contrôle d'accès granulaire.

ROSTemplateFormatVersion: '2015-09-01'
Description:
  zh-cn: 创建RAM用户组并配置内联自定义策略,限定特定资源的操作权限。
  en: Create a RAM group with inline custom policies for fine-grained access control.
Parameters:
  GroupName:
    Type: String
    Label:
      zh-cn: 用户组名称
      en: Group Name
    Description:
      zh-cn: RAM用户组名称。
      en: The RAM group name.
    Default: dev-team
  Comments:
    Type: String
    Label:
      zh-cn: 用户组备注
      en: Group Comments
    Description:
      zh-cn: 用户组的备注说明。
      en: Comments for the group.
    Default: 开发团队权限组,拥有指定资源的读写权限
    MaxLength: 128
  OssBucketName:
    Type: String
    Label:
      zh-cn: OSS存储桶名称
      en: OSS Bucket Name
    Description:
      zh-cn: 允许开发团队访问的OSS存储桶名称。
      en: The OSS bucket name that the dev team is allowed to access.
Resources:
  Group:
    Type: ALIYUN::RAM::Group
    Properties:
      GroupName:
        Ref: GroupName
      Comments:
        Ref: Comments
      Policies:
        - PolicyName:
            Fn::Sub: ${GroupName}-oss-policy
          Description: 允许对指定OSS存储桶进行读写操作
          PolicyDocument:
            Version: '1'
            Statement:
              - Effect: Allow
                Action:
                  - oss:GetObject
                  - oss:PutObject
                  - oss:DeleteObject
                  - oss:ListObjects
                  - oss:GetBucket
                Resource:
                  - Fn::Sub: acs:oss:*:*:${OssBucketName}
                  - Fn::Sub: acs:oss:*:*:${OssBucketName}/*
        - PolicyName:
            Fn::Sub: ${GroupName}-ecs-policy
          Description: 允许查看和管理ECS实例
          PolicyDocument:
            Version: '1'
            Statement:
              - Effect: Allow
                Action:
                  - ecs:DescribeInstances
                  - ecs:DescribeInstanceStatus
                  - ecs:StartInstance
                  - ecs:StopInstance
                  - ecs:RebootInstance
                Resource:
                  - '*'
              - Effect: Deny
                Action:
                  - ecs:DeleteInstance
                Resource:
                  - '*'
      DeletionForce: true
Outputs:
  GroupName:
    Label:
      zh-cn: 用户组名称
      en: Group Name
    Description:
      zh-cn: 创建成功的RAM用户组名称。
      en: The name of the created RAM group.
    Value:
      Fn::GetAtt:
        - Group
        - GroupName
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
    "zh-cn": "创建RAM用户组并配置内联自定义策略,限定特定资源的操作权限。",
    "en": "Create a RAM group with inline custom policies for fine-grained access control."
  },
  "Parameters": {
    "GroupName": {
      "Type": "String",
      "Label": {
        "zh-cn": "用户组名称",
        "en": "Group Name"
      },
      "Description": {
        "zh-cn": "RAM用户组名称。",
        "en": "The RAM group name."
      },
      "Default": "dev-team"
    },
    "Comments": {
      "Type": "String",
      "Label": {
        "zh-cn": "用户组备注",
        "en": "Group Comments"
      },
      "Description": {
        "zh-cn": "用户组的备注说明。",
        "en": "Comments for the group."
      },
      "Default": "开发团队权限组,拥有指定资源的读写权限",
      "MaxLength": 128
    },
    "OssBucketName": {
      "Type": "String",
      "Label": {
        "zh-cn": "OSS存储桶名称",
        "en": "OSS Bucket Name"
      },
      "Description": {
        "zh-cn": "允许开发团队访问的OSS存储桶名称。",
        "en": "The OSS bucket name that the dev team is allowed to access."
      }
    }
  },
  "Resources": {
    "Group": {
      "Type": "ALIYUN::RAM::Group",
      "Properties": {
        "GroupName": {
          "Ref": "GroupName"
        },
        "Comments": {
          "Ref": "Comments"
        },
        "Policies": [
          {
            "PolicyName": {
              "Fn::Sub": "${GroupName}-oss-policy"
            },
            "Description": "允许对指定OSS存储桶进行读写操作",
            "PolicyDocument": {
              "Version": "1",
              "Statement": [
                {
                  "Effect": "Allow",
                  "Action": [
                    "oss:GetObject",
                    "oss:PutObject",
                    "oss:DeleteObject",
                    "oss:ListObjects",
                    "oss:GetBucket"
                  ],
                  "Resource": [
                    {
                      "Fn::Sub": "acs:oss:*:*:${OssBucketName}"
                    },
                    {
                      "Fn::Sub": "acs:oss:*:*:${OssBucketName}/*"
                    }
                  ]
                }
              ]
            }
          },
          {
            "PolicyName": {
              "Fn::Sub": "${GroupName}-ecs-policy"
            },
            "Description": "允许查看和管理ECS实例",
            "PolicyDocument": {
              "Version": "1",
              "Statement": [
                {
                  "Effect": "Allow",
                  "Action": [
                    "ecs:DescribeInstances",
                    "ecs:DescribeInstanceStatus",
                    "ecs:StartInstance",
                    "ecs:StopInstance",
                    "ecs:RebootInstance"
                  ],
                  "Resource": [
                    "*"
                  ]
                },
                {
                  "Effect": "Deny",
                  "Action": [
                    "ecs:DeleteInstance"
                  ],
                  "Resource": [
                    "*"
                  ]
                }
              ]
            }
          }
        ],
        "DeletionForce": true
      }
    }
  },
  "Outputs": {
    "GroupName": {
      "Label": {
        "zh-cn": "用户组名称",
        "en": "Group Name"
      },
      "Description": {
        "zh-cn": "创建成功的RAM用户组名称。",
        "en": "The name of the created RAM group."
      },
      "Value": {
        "Fn::GetAtt": [
          "Group",
          "GroupName"
        ]
      }
    }
  }
}

Scénario 3 : Créer un groupe RAM avec des attachements de stratégies système et personnalisées pour un contrôle d'accès hybride.

ROSTemplateFormatVersion: '2015-09-01'
Description:
  zh-cn: 创建RAM用户组并同时附加系统策略和自定义策略,实现混合权限管理。
  en: Create a RAM group with both system and custom policy attachments for hybrid access control.
Parameters:
  GroupName:
    Type: String
    Label:
      zh-cn: 用户组名称
      en: Group Name
    Description:
      zh-cn: RAM用户组名称,1~64个字符。
      en: RAM group name, 1-64 characters.
    Default: ops-team
  Comments:
    Type: String
    Label:
      zh-cn: 用户组备注
      en: Group Comments
    Description:
      zh-cn: 用户组的备注说明。
      en: Comments for the group.
    Default: 运维团队权限组,拥有系统和自定义混合权限
    MaxLength: 128
  SystemPolicies:
    Type: Json
    Label:
      zh-cn: 系统策略列表
      en: System Policies
    Description:
      zh-cn: >-
        要附加的系统预置策略名称列表,最多20条。
        常用策略:AliyunECSFullAccess、AliyunOSSFullAccess、
        AliyunRDSFullAccess、AliyunVPCFullAccess、AliyunSLBFullAccess。
      en: >-
        List of system policy names to attach, up to 20.
    Default:
      - AliyunECSFullAccess
      - AliyunVPCFullAccess
      - AliyunSLBFullAccess
    AssociationProperty: List[Parameter]
    AssociationPropertyMetadata:
      Parameter:
        Type: String
        Required: true
        Label:
          zh-cn: 系统策略名称
          en: System Policy Name
  CustomPolicies:
    Type: Json
    Label:
      zh-cn: 自定义策略列表
      en: Custom Policies
    Description:
      zh-cn: >-
        要附加的自定义策略名称列表,最多5条。
        需要提前在RAM控制台创建好自定义策略。
      en: >-
        List of custom policy names to attach, up to 5.
        Custom policies must be created in RAM console first.
    Default: []
    AssociationProperty: List[Parameter]
    AssociationPropertyMetadata:
      Parameter:
        Type: String
        Required: false
        Label:
          zh-cn: 自定义策略名称
          en: Custom Policy Name
Resources:
  Group:
    Type: ALIYUN::RAM::Group
    Properties:
      GroupName:
        Ref: GroupName
      Comments:
        Ref: Comments
      PolicyAttachments:
        System:
          Ref: SystemPolicies
        Custom:
          Ref: CustomPolicies
      DeletionForce: true
      IgnoreExisting: true
Outputs:
  GroupName:
    Label:
      zh-cn: 用户组名称
      en: Group Name
    Description:
      zh-cn: 创建成功的RAM用户组名称。
      en: The name of the created RAM group.
    Value:
      Fn::GetAtt:
        - Group
        - GroupName
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
    "zh-cn": "创建RAM用户组并同时附加系统策略和自定义策略,实现混合权限管理。",
    "en": "Create a RAM group with both system and custom policy attachments for hybrid access control."
  },
  "Parameters": {
    "GroupName": {
      "Type": "String",
      "Label": {
        "zh-cn": "用户组名称",
        "en": "Group Name"
      },
      "Description": {
        "zh-cn": "RAM用户组名称,1~64个字符。",
        "en": "RAM group name, 1-64 characters."
      },
      "Default": "ops-team"
    },
    "Comments": {
      "Type": "String",
      "Label": {
        "zh-cn": "用户组备注",
        "en": "Group Comments"
      },
      "Description": {
        "zh-cn": "用户组的备注说明。",
        "en": "Comments for the group."
      },
      "Default": "运维团队权限组,拥有系统和自定义混合权限",
      "MaxLength": 128
    },
    "SystemPolicies": {
      "Type": "Json",
      "Label": {
        "zh-cn": "系统策略列表",
        "en": "System Policies"
      },
      "Description": {
        "zh-cn": "要附加的系统预置策略名称列表,最多20条。常用策略:AliyunECSFullAccess、AliyunOSSFullAccess、AliyunRDSFullAccess、AliyunVPCFullAccess、AliyunSLBFullAccess。",
        "en": "List of system policy names to attach, up to 20."
      },
      "Default": [
        "AliyunECSFullAccess",
        "AliyunVPCFullAccess",
        "AliyunSLBFullAccess"
      ],
      "AssociationProperty": "List[Parameter]",
      "AssociationPropertyMetadata": {
        "Parameter": {
          "Type": "String",
          "Required": true,
          "Label": {
            "zh-cn": "系统策略名称",
            "en": "System Policy Name"
          }
        }
      }
    },
    "CustomPolicies": {
      "Type": "Json",
      "Label": {
        "zh-cn": "自定义策略列表",
        "en": "Custom Policies"
      },
      "Description": {
        "zh-cn": "要附加的自定义策略名称列表,最多5条。需要提前在RAM控制台创建好自定义策略。",
        "en": "List of custom policy names to attach, up to 5. Custom policies must be created in RAM console first."
      },
      "Default": [],
      "AssociationProperty": "List[Parameter]",
      "AssociationPropertyMetadata": {
        "Parameter": {
          "Type": "String",
          "Required": false,
          "Label": {
            "zh-cn": "自定义策略名称",
            "en": "Custom Policy Name"
          }
        }
      }
    }
  },
  "Resources": {
    "Group": {
      "Type": "ALIYUN::RAM::Group",
      "Properties": {
        "GroupName": {
          "Ref": "GroupName"
        },
        "Comments": {
          "Ref": "Comments"
        },
        "PolicyAttachments": {
          "System": {
            "Ref": "SystemPolicies"
          },
          "Custom": {
            "Ref": "CustomPolicies"
          }
        },
        "DeletionForce": true,
        "IgnoreExisting": true
      }
    }
  },
  "Outputs": {
    "GroupName": {
      "Label": {
        "zh-cn": "用户组名称",
        "en": "Group Name"
      },
      "Description": {
        "zh-cn": "创建成功的RAM用户组名称。",
        "en": "The name of the created RAM group."
      },
      "Value": {
        "Fn::GetAtt": [
          "Group",
          "GroupName"
        ]
      }
    }
  }
}