すべてのプロダクト
Search
ドキュメントセンター

Resource Orchestration Service:ALIYUN::CS::GrantPermissions

最終更新日:Mar 17, 2025

ALIYUN::CS::GrantPermissions は、Resource Access Management (RAM) ユーザーまたは RAM ロールにロールベースアクセス制御 (RBAC) 権限を付与するために使用されます。

構文

{
  "Type": "ALIYUN::CS::GrantPermissions",
  "Properties": {
    "Permissions": List,
    "UserId": String
  }
}

プロパティ

プロパティ

タイプ

必須

編集可能

説明

制約

Permissions

List

はい

はい

RAM ユーザーに付与する権限。

詳細については、「Permissions プロパティ」をご参照ください。

UserId

String

はい

はい

RAM ロールの ID。

なし。

Permissions 構文

"Permissions": [
  {
    "RoleName": String,
    "ClusterId": String,
    "RoleType": String,
    "IsCustom": Boolean,
    "IsRamRole": Boolean,
    "Namespace": String
  }
]

Permissions プロパティ

プロパティ

タイプ

必須

編集可能

説明

制約

ClusterId

String

はい

はい

RBAC 権限を付与するクラスターの ID。

RoleTypeall-clusters に設定されている場合は、このプロパティを空のままにする必要があります。

RoleName

String

はい

はい

事前定義されたロール。

有効な値:

  • admin: 管理者

  • ops: 運用エンジニア

  • dev: 開発者

  • restricted: 制限付きユーザー

  • クラスターロール: 指定したクラスターロール

RoleType

String

はい

はい

承認範囲。

有効な値:

  • cluster

  • namespace

  • all-clusters

IsCustom

Boolean

いいえ

はい

カスタム承認を実行するかどうかを指定します。

有効な値:

  • true

  • false

IsRamRole

Boolean

いいえ

はい

RAM ロールに権限を付与するかどうかを指定します。

有効な値:

  • true

  • false

Namespace

String

いいえ

はい

名前空間。

デフォルトでは、RoleType が cluster に設定されている場合、このプロパティは空です。

戻り値

Fn::GetAtt

なし。

YAML フォーマット

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  UserId:
    Type: String
    Description:
      en: The ID of the RAM user.
    Required: true
  Permissions:
    AssociationPropertyMetadata:
      Parameters:
        RoleName:
          Type: String
          Description:
            en: |-
              he predefined role name. Valid values:
              admin: administrator
              ops: O&M engineer
              dev: developer
              restricted: restricted user
              The custom cluster role.
          Required: true
        ClusterId:
          Type: String
          Description:
            en: The ID of the cluster that you want to manage. When the role_type parameter is set to all-clusters, this parameter is set to an empty string.
          Required: true
        RoleType:
          Type: String
          Description:
            en: |-
              The authorization type. Valid values:
              cluster: indicates that the permissions are scoped to a cluster.
              namespace: specifies that the permissions are scoped to a namespace of a cluster.
              all-clusters: specifies that the permissions are scoped to all clusters.
          AllowedValues:
            - cluster
            - namespace
            - all-clusters
          Required: true
    AssociationProperty: List[Parameters]
    Type: Json
    Description:
      en: 'The permissions that you want to grant to the RAM user. '
    Required: true
    MinLength: 0
    MaxLength: 20
Resources:
  GrantPermissions:
    Type: ALIYUN::CS::GrantPermissions
    Properties:
      UserId:
        Ref: UserId
      Permissions:
        Ref: Permissions

JSON フォーマット

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "UserId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the RAM user."
      },
      "Required": true
    },
    "Permissions": {
      "AssociationPropertyMetadata": {
        "Parameters": {
          "RoleName": {
            "Type": "String",
            "Description": {
              "en": "he predefined role name. Valid values:\nadmin: administrator\nops: O&M engineer\ndev: developer\nrestricted: restricted user\nThe custom cluster role."
            },
            "Required": true
          },
          "ClusterId": {
            "Type": "String",
            "Description": {
              "en": "The ID of the cluster that you want to manage. When the role_type parameter is set to all-clusters, this parameter is set to an empty string."
            },
            "Required": true
          },
          "RoleType": {
            "Type": "String",
            "Description": {
              "en": "The authorization type. Valid values:\ncluster: indicates that the permissions are scoped to a cluster.\nnamespace: specifies that the permissions are scoped to a namespace of a cluster.\nall-clusters: specifies that the permissions are scoped to all clusters."
            },
            "AllowedValues": [
              "cluster",
              "namespace",
              "all-clusters"
            ],
            "Required": true
          }
        }
      },
      "AssociationProperty": "List[Parameters]",
      "Type": "Json",
      "Description": {
        "en": "The permissions that you want to grant to the RAM user. "
      },
      "Required": true,
      "MinLength": 0,
      "MaxLength": 20
    }
  },
  "Resources": {
    "GrantPermissions": {
      "Type": "ALIYUN::CS::GrantPermissions",
      "Properties": {
        "UserId": {
          "Ref": "UserId"
        },
        "Permissions": {
          "Ref": "Permissions"
        }
      }
    }
  }
}