Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Managed Service for ClickHouse®
  • Getting started
    • All guides
      • Information about existing clusters
      • Creating a cluster
      • Updating cluster settings
      • Getting the ClickHouse® patch version
      • ClickHouse® version upgrade
      • Stopping and starting a cluster
      • Managing backups
      • Managing cluster access
      • Deleting a cluster
  • Access management
  • Pricing policy
  • Terraform reference
  • Yandex Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes

In this article:

  • Getting a list of roles assigned for a cluster
  • Assigning a role
  • Assigning multiple roles
  • Revoking a role
  • Examples
  • Granting cluster management access to a service account
  1. Step-by-step guides
  2. Clusters
  3. Managing cluster access

Managing access to a Managed Service for ClickHouse® cluster

Written by
Yandex Cloud
Updated at February 13, 2026
  • Getting a list of roles assigned for a cluster
  • Assigning a role
  • Assigning multiple roles
  • Revoking a role
  • Examples
    • Granting cluster management access to a service account

You can assign a user or service account a role that grants access to a specific cluster.

Thus, you can granularly assign different roles for particular clusters to different users and service accounts.

Getting a list of roles assigned for a clusterGetting a list of roles assigned for a cluster

CLI
REST API
gRPC API

If you do not have the Yandex Cloud CLI installed yet, install and initialize it.

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

  1. To get a list of clusters in the default folder, run this command:

    yc managed-clickhouse cluster list
    
  2. To get a list of roles assigned for the cluster, run this command:

    yc managed-clickhouse cluster list-access-bindings <cluster_name_or_ID>
    
  1. Get an IAM token for API authentication and place it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Call the Cluster.ListAccessBindings method, e.g., via the following cURL request:

    curl \
      --request GET \
      --header "Authorization: Bearer $IAM_TOKEN" \
      --header "Content-Type: application/json" \
      --url 'https://mdb.api.cloud.yandex.net/managed-clickhouse/v1/clusters/<cluster_ID>:listAccessBindings'
    
  3. View the server response to make sure your request was successful.

  1. Get an IAM token for API authentication and place it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume that the repository contents reside in the ~/cloudapi/ directory.

  3. Call the ClusterService.ListAccessBindings method, e.g., via the following gRPCurl request:

    grpcurl \
      -format json \
      -import-path ~/cloudapi/ \
      -import-path ~/cloudapi/third_party/googleapis/ \
      -proto ~/cloudapi/yandex/cloud/mdb/clickhouse/v1/cluster_service.proto \
      -rpc-header "Authorization: Bearer $IAM_TOKEN" \
      -d '{
            "resource_id": "<cluster_ID>"
          }' \
      mdb.api.cloud.yandex.net:443 \
      yandex.cloud.mdb.clickhouse.v1.ClusterService.ListAccessBindings
    
  4. Check the server response to make sure your request was successful.

Assigning a roleAssigning a role

CLI
REST API
gRPC API

If you do not have the Yandex Cloud CLI installed yet, install and initialize it.

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

  1. View the description of the CLI command for assigning a role for a cluster:

    yc managed-clickhouse cluster add-access-binding --help
    
  2. Use this command to assign a role:

    yc managed-clickhouse cluster add-access-binding <cluster_name_or_ID> \
      --role <role> \
      --subject <subject_type>:<subject_ID>
    

    Where:

    • --role: Role being assigned, e.g., managed-clickhouse.editor.

    • --subject: Type and ID of the subject you are assigning the role to, in <subject_type>:<subject_ID> format.

      For example:

      • serviceAccount:aje6p030************
      • userAccount:aje8tj79************
      • system:allAuthenticatedUsers

      The possible subject types include:

      • userAccount: Yandex account added to Yandex Cloud or an account from a user pool.

      • serviceAccount: Service account created in Yandex Cloud.

      • federatedUser: Account of an identity federation user.

      • system: Public group of users.

        The possible values of a subject ID are as follows:

        • allAuthenticatedUsers: All authenticated users.
        • allUsers: Any user. No authentication is required.
        • group:organization:<organization_ID>:users: All users of the specified organization.
        • group:federation:<federation_ID>:users: All users of the specified identity federation.

      Learn more about subject types in Subject a role is assigned to.

  3. To view a list of roles assigned for the cluster, run this command:

    yc managed-clickhouse cluster list-access-bindings <cluster_name_or_ID>
    
  1. Get an IAM token for API authentication and place it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Call the Cluster.UpdateAccessBindings method, e.g., via the following cURL request:

    curl \
      --request PATCH \
      --header "Authorization: Bearer $IAM_TOKEN" \
      --header "Content-Type: application/json" \
      --url 'https://mdb.api.cloud.yandex.net/managed-clickhouse/v1/clusters/<cluster_ID>:updateAccessBindings' \
      --data '{
                "access_binding_deltas": [
                  {
                    "action": "ADD",
                    "access_binding": {
                      "role_id": "<role>",
                      "subject": {
                        "id": "<subject_ID>",
                        "type": "<subject_type>"
                      }
                    }
                  }
                ]
              }'
    

    Where:

    • access_binding_deltas.roleId: Role being assigned, e.g., managed-clickhouse.editor.

    • access_binding_deltas.subject.id: ID of the subject the role is assigned to.

    • access_binding_deltas.subject.type: Type of subject the role is assigned to.

      The possible subject types include:

      • userAccount: Yandex account added to Yandex Cloud or an account from a user pool.

      • serviceAccount: Service account created in Yandex Cloud.

      • federatedUser: Account of an identity federation user.

      • system: Public group of users.

        The possible values of a subject ID are as follows:

        • allAuthenticatedUsers: All authenticated users.
        • allUsers: Any user. No authentication is required.
        • group:organization:<organization_ID>:users: All users of the specified organization.
        • group:federation:<federation_ID>:users: All users of the specified identity federation.

      Learn more about subject types in Subject a role is assigned to.

  3. Check the server response to make sure your request was successful.

  1. Get an IAM token for API authentication and place it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume that the repository contents reside in the ~/cloudapi/ directory.

  3. Call the ClusterService.UpdateAccessBindings method, e.g., via the following gRPCurl request:

    grpcurl \
      -format json \
      -import-path ~/cloudapi/ \
      -import-path ~/cloudapi/third_party/googleapis/ \
      -proto ~/cloudapi/yandex/cloud/mdb/clickhouse/v1/cluster_service.proto \
      -rpc-header "Authorization: Bearer $IAM_TOKEN" \
      -d '{
            "resource_id": "<cluster_ID>",
            "access_binding_deltas": [
              {
                "action": "ADD",
                "access_binding": {
                  "role_id": "<role>",
                  "subject": {
                    "id": "<subject_ID>",
                    "type": "<subject_type>"
                  }
                }
              }
            ]
          }' \
      mdb.api.cloud.yandex.net:443 \
      yandex.cloud.mdb.clickhouse.v1.ClusterService.UpdateAccessBindings
    

    Where:

    • resource_id: Cluster ID.

    • access_binding_deltas.roleId: Role being assigned, e.g., managed-clickhouse.editor.

    • access_binding_deltas.subject.id: ID of the subject the role is assigned to.

    • access_binding_deltas.subject.type: Type of subject the role is assigned to.

      The possible subject types include:

      • userAccount: Yandex account added to Yandex Cloud or an account from a user pool.

      • serviceAccount: Service account created in Yandex Cloud.

      • federatedUser: Account of an identity federation user.

      • system: Public group of users.

        The possible values of a subject ID are as follows:

        • allAuthenticatedUsers: All authenticated users.
        • allUsers: Any user. No authentication is required.
        • group:organization:<organization_ID>:users: All users of the specified organization.
        • group:federation:<federation_ID>:users: All users of the specified identity federation.

      Learn more about subject types in Subject a role is assigned to.

  4. Check the server response to make sure your request was successful.

Assigning multiple rolesAssigning multiple roles

CLI
REST API
gRPC API

If you do not have the Yandex Cloud CLI installed yet, install and initialize it.

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

Alert

The set-access-bindings command deletes all roles assigned for the cluster and assigns new ones.

  1. To view a list of roles assigned for the cluster, run this command:

    yc managed-clickhouse cluster list-access-bindings <cluster_name_or_ID>
    
  2. View the description of the CLI command for assigning roles for a cluster:

    yc managed-clickhouse cluster set-access-bindings --help
    
  3. To assign roles, run this command:

    yc managed-clickhouse cluster set-access-bindings <cluster_name_or_ID> \
      --access-binding role=<role>,subject=<subject_type>:<subject_1_ID> \
      --access-binding role=<role>,subject=<subject_type>:<subject_2_ID>
    

    Where --access-binding assigns a role to a subject. You can assign multiple roles at once by describing each of them in a separate --access-binding parameter.

    • role: Role being assigned, e.g., managed-clickhouse.editor.

    • subject: Type and ID of the subject you are assigning the role to, in <subject_type>:<subject_ID> format.

      For example:

      • serviceAccount:aje6p030************
      • userAccount:aje8tj79************
      • system:allAuthenticatedUsers

      The possible subject types include:

      • userAccount: Yandex account added to Yandex Cloud or an account from a user pool.

      • serviceAccount: Service account created in Yandex Cloud.

      • federatedUser: Account of an identity federation user.

      • system: Public group of users.

        The possible values of a subject ID are as follows:

        • allAuthenticatedUsers: All authenticated users.
        • allUsers: Any user. No authentication is required.
        • group:organization:<organization_ID>:users: All users of the specified organization.
        • group:federation:<federation_ID>:users: All users of the specified identity federation.

      Learn more about subject types in Subject a role is assigned to.

Alert

The setAccessBindings method overwrites access permissions for the resource. All roles previously assigned for this resource will be deleted.

  1. Get an IAM token for API authentication and place it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Call the Cluster.SetAccessBindings method, e.g., via the following cURL request:

    curl \
      --request POST \
      --header "Authorization: Bearer $IAM_TOKEN" \
      --header "Content-Type: application/json" \
      --url 'https://mdb.api.cloud.yandex.net/managed-clickhouse/v1/clusters/<cluster_ID>:setAccessBindings' \
      --data '{
                "accessBindings": [
                  {
                    "roleId": "<role>",
                    "subject": {
                      "id": "<subject_1_ID>",
                      "type": "<subject_type>"
                    }
                  },
                  {
                    "roleId": "<role>",
                    "subject": {
                      "id": "<subject_2_ID>",
                      "type": "<subject_type>"
                    }
                  },
                  ...
                  {
                    "roleId": "<role>",
                    "subject": {
                      "id": "<subject_N_ID>",
                      "type": "<subject_type>"
                    }
                  }
                ]
              }'
    

    Where:

    • accessBindings.roleId: Role being assigned, e.g., managed-clickhouse.editor.

    • accessBindings.subject.id: ID of the subject the role is assigned to.

    • accessBindings.subject.type: Type of subject the role is assigned to.

      The possible subject types include:

      • userAccount: Yandex account added to Yandex Cloud or an account from a user pool.

      • serviceAccount: Service account created in Yandex Cloud.

      • federatedUser: Account of an identity federation user.

      • system: Public group of users.

        The possible values of a subject ID are as follows:

        • allAuthenticatedUsers: All authenticated users.
        • allUsers: Any user. No authentication is required.
        • group:organization:<organization_ID>:users: All users of the specified organization.
        • group:federation:<federation_ID>:users: All users of the specified identity federation.

      Learn more about subject types in Subject a role is assigned to.

  3. Check the server response to make sure your request was successful.

Alert

The ClusterService.SetAccessBindings method completely overwrites access permissions for the resource. All roles previously assigned for this resource will be deleted.

  1. Get an IAM token for API authentication and place it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume that the repository contents reside in the ~/cloudapi/ directory.

  3. Call the ClusterService.SetAccessBindings method, e.g., via the following gRPCurl request:

    grpcurl \
      -format json \
      -import-path ~/cloudapi/ \
      -import-path ~/cloudapi/third_party/googleapis/ \
      -proto ~/cloudapi/yandex/cloud/mdb/clickhouse/v1/cluster_service.proto \
      -rpc-header "Authorization: Bearer $IAM_TOKEN" \
      -d '{
            "resource_id": "<cluster_ID>",
            "accessBindings": [
              {
                "roleId": "<role>",
                "subject": {
                  "id": "<subject_1_ID>",
                  "type": "<subject_type>"
                }
              },
              {
                "roleId": "<role>",
                "subject": {
                  "id": "<subject_2_ID>",
                  "type": "<subject_type>"
                }
              },
              ...
              {
                "roleId": "<role>",
                "subject": {
                  "id": "<subject_N_ID>",
                  "type": "<subject_type>"
                }
              }
            ]
          }' \
      mdb.api.cloud.yandex.net:443 \
      yandex.cloud.mdb.clickhouse.v1.ClusterService.SetAccessBindings
    

    Where:

    • resource_id: Cluster ID.

    • accessBindings.roleId: Role being assigned, e.g., managed-clickhouse.editor.

    • accessBindings.subject.id: ID of the subject the role is assigned to.

    • accessBindings.subject.type: Type of subject the role is assigned to.

      The possible subject types include:

      • userAccount: Yandex account added to Yandex Cloud or an account from a user pool.

      • serviceAccount: Service account created in Yandex Cloud.

      • federatedUser: Account of an identity federation user.

      • system: Public group of users.

        The possible values of a subject ID are as follows:

        • allAuthenticatedUsers: All authenticated users.
        • allUsers: Any user. No authentication is required.
        • group:organization:<organization_ID>:users: All users of the specified organization.
        • group:federation:<federation_ID>:users: All users of the specified identity federation.

      Learn more about subject types in Subject a role is assigned to.

  4. Check the server response to make sure your request was successful.

Revoking a roleRevoking a role

CLI
REST API
gRPC API

If you do not have the Yandex Cloud CLI installed yet, install and initialize it.

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

  1. To view a list of roles assigned for the cluster, run this command:

    yc managed-clickhouse cluster list-access-bindings <cluster_name_or_ID>
    
  2. View the description of the CLI command for revoking a role for a cluster:

    yc managed-clickhouse cluster remove-access-binding --help
    
  3. To revoke a role, run this command:

    yc managed-clickhouse cluster remove-access-binding <cluster_name_or_ID> \
      --role <role> \
      --subject <subject_type>:<subject_ID>
    

    Where:

    • --role: Role being revoked, e.g., managed-clickhouse.editor.

    • --subject: Type and ID of the subject the role is assigned to, in <subject_type>:<subject_ID> format.

      For example:

      • serviceAccount:aje6p030************
      • userAccount:aje8tj79************
      • system:allAuthenticatedUsers

      The possible subject types include:

      • userAccount: Yandex account added to Yandex Cloud or an account from a user pool.

      • serviceAccount: Service account created in Yandex Cloud.

      • federatedUser: Account of an identity federation user.

      • system: Public group of users.

        The possible values of a subject ID are as follows:

        • allAuthenticatedUsers: All authenticated users.
        • allUsers: Any user. No authentication is required.
        • group:organization:<organization_ID>:users: All users of the specified organization.
        • group:federation:<federation_ID>:users: All users of the specified identity federation.

      Learn more about subject types in Subject a role is assigned to.

  1. Get an IAM token for API authentication and place it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Call the Cluster.UpdateAccessBindings method, e.g., via the following cURL request:

    curl \
      --request PATCH \
      --header "Authorization: Bearer $IAM_TOKEN" \
      --header "Content-Type: application/json" \
      --url 'https://mdb.api.cloud.yandex.net/managed-clickhouse/v1/clusters/<cluster_ID>:updateAccessBindings' \
      --data '{
                "access_binding_deltas": [
                  {
                    "action": "REMOVE",
                    "access_binding": {
                      "role_id": "<role>",
                      "subject": {
                        "id": "<subject_ID>",
                        "type": "<subject_type>"
                      }
                    }
                  }
                ]
              }'
    

    Where:

    • access_binding_deltas.roleId: Role being assigned, e.g., managed-clickhouse.editor.

    • access_binding_deltas.subject.id: ID of the subject the role is assigned to.

    • access_binding_deltas.subject.type: Type of subject the role is assigned to.

      The possible subject types include:

      • userAccount: Yandex account added to Yandex Cloud or an account from a user pool.

      • serviceAccount: Service account created in Yandex Cloud.

      • federatedUser: Account of an identity federation user.

      • system: Public group of users.

        The possible values of a subject ID are as follows:

        • allAuthenticatedUsers: All authenticated users.
        • allUsers: Any user. No authentication is required.
        • group:organization:<organization_ID>:users: All users of the specified organization.
        • group:federation:<federation_ID>:users: All users of the specified identity federation.

      Learn more about subject types in Subject a role is assigned to.

  3. Check the server response to make sure your request was successful.

  1. Get an IAM token for API authentication and place it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume that the repository contents reside in the ~/cloudapi/ directory.

  3. Call the ClusterService.UpdateAccessBindings method, e.g., via the following gRPCurl request:

    grpcurl \
      -format json \
      -import-path ~/cloudapi/ \
      -import-path ~/cloudapi/third_party/googleapis/ \
      -proto ~/cloudapi/yandex/cloud/mdb/clickhouse/v1/cluster_service.proto \
      -rpc-header "Authorization: Bearer $IAM_TOKEN" \
      -d '{
            "resource_id": "<cluster_ID>",
            "access_binding_deltas": [
              {
                "action": "REMOVE",
                "access_binding": {
                  "role_id": "<role>",
                  "subject": {
                    "id": "<subject_ID>",
                    "type": "<subject_type>"
                  }
                }
              }
            ]
          }' \
      mdb.api.cloud.yandex.net:443 \
      yandex.cloud.mdb.clickhouse.v1.ClusterService.UpdateAccessBindings
    

    Where:

    • resource_id: Cluster ID.

    • access_binding_deltas.roleId: Role being revoked, e.g., managed-clickhouse.editor.

    • access_binding_deltas.subject.id: ID of the subject to revoke the role from.

    • access_binding_deltas.subject.type: Subject type to revoke a role from.

      The possible subject types include:

      • userAccount: Yandex account added to Yandex Cloud or an account from a user pool.

      • serviceAccount: Service account created in Yandex Cloud.

      • federatedUser: Account of an identity federation user.

      • system: Public group of users.

        The possible values of a subject ID are as follows:

        • allAuthenticatedUsers: All authenticated users.
        • allUsers: Any user. No authentication is required.
        • group:organization:<organization_ID>:users: All users of the specified organization.
        • group:federation:<federation_ID>:users: All users of the specified identity federation.

      Learn more about subject types in Subject a role is assigned to.

  4. Check the server response to make sure your request was successful.

ExamplesExamples

Granting cluster management access to a service accountGranting cluster management access to a service account

For a service account to be able to view the info of all Managed Service for ClickHouse® clusters in the folder but modify the resources in one particular cluster alone, give it the managed-clickhouse.viewer role for the folder and the managed-clickhouse.editor role for that cluster:

CLI
REST API
gRPC API
  1. Assign the role for the folder:

    yc resource-manager folder add-access-binding <folder_name_or_ID> \
      --role managed-clickhouse.viewer \
      --subject=serviceAccount:<service_account_ID>
    
  2. Assign the roles for the cluster:

    yc managed-clickhouse cluster add-access-bindings <cluster_name_or_ID> \
      --access-binding role=managed-clickhouse.editor,subject=serviceAccount:<service_account_ID>
    
  3. Check the list of roles assigned for the cluster:

    yc managed-clickhouse cluster list-access-bindings <cluster_name_or_ID>
    
  1. Get an IAM token for API authentication and place it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Assign the role for the folder:

    curl \
      --request POST \
      --header "Authorization: Bearer $IAM_TOKEN" \
      --header "Content-Type: application/json" \
      --url 'https://resource-manager.api.cloud.yandex.net/resource-manager/v1/folders/<folder_ID>:updateAccessBindings' \
      --data '{
                "access_binding_deltas": [
                  {
                    "action": "ADD",
                    "access_binding": {
                      "role_id": "managed-clickhouse.viewer",
                      "subject": {
                        "id": "<service_account_ID>",
                        "type": "serviceAccount"
                      }
                    }
                  }
                ]
              }'
    

    access_binding_deltas.subject.id: ID of the service account the role is assigned to.

  3. Call the Cluster.UpdateAccessBindings method, e.g., via the following cURL request:

    curl \
      --request PATCH \
      --header "Authorization: Bearer $IAM_TOKEN" \
      --header "Content-Type: application/json" \
      --url 'https://mdb.api.cloud.yandex.net/managed-clickhouse/v1/clusters/<cluster_ID>:updateAccessBindings' \
      --data '{
                "access_binding_deltas": [
                  {
                    "action": "ADD",
                    "access_binding": {
                      "role_id": "managed-clickhouse.editor",
                      "subject": {
                        "id": "<service_account_ID>",
                        "type": "serviceAccount"
                      }
                    }
                  }
                ]
              }'
    

    access_binding_deltas.subject.id: ID of the service account the role is assigned to.

  4. Check the list of roles assigned for the folder:

    curl \
      --request GET \
      --header "Authorization: Bearer $IAM_TOKEN" \
      --header "Content-Type: application/json" \
      --url 'https://resource-manager.api.cloud.yandex.net/resource-manager/v1/folders/<folder_ID>:updateAccessBindings'
    
  5. Check the list of roles assigned for the cluster:

    curl \
      --request GET \
      --header "Authorization: Bearer $IAM_TOKEN" \
      --header "Content-Type: application/json" \
      --url 'https://mdb.api.cloud.yandex.net/managed-clickhouse/v1/clusters/<cluster_ID>:listAccessBindings'
    
  1. Get an IAM token for API authentication and place it in an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume that the repository contents reside in the ~/cloudapi/ directory.

  3. Assign the role for the folder:

    grpcurl \
      -format json \
      -import-path ~/cloudapi/ \
      -import-path ~/cloudapi/third_party/googleapis/ \
      -proto ~/cloudapi/yandex/cloud/resourcemanager/v1/folder_service.proto \
      -rpc-header "Authorization: Bearer $IAM_TOKEN" \
      -d '{
            "resource_id": "<cluster_ID>",
            "access_binding_deltas": [
              {
                "action": "ADD",
                "access_binding": {
                  "role_id": "managed-clickhouse.viewer",
                  "subject": {
                    "id": "<service_account_ID>",
                    "type": "serviceAccount"
                  }
                }
              }
            ]
          }' \
      resource-manager.api.cloud.yandex.net:443 \
      yandex.cloud.resourcemanager.v1.FolderService.UpdateAccessBindings
    

    access_binding_deltas.subject.id: ID of the service account the role is assigned to.

  4. Assign the role for the cluster:

    grpcurl \
      -format json \
      -import-path ~/cloudapi/ \
      -import-path ~/cloudapi/third_party/googleapis/ \
      -proto ~/cloudapi/yandex/cloud/mdb/clickhouse/v1/cluster_service.proto \
      -rpc-header "Authorization: Bearer $IAM_TOKEN" \
      -d '{
            "resource_id": "<cluster_ID>",
            "access_binding_deltas": [
              {
                "action": "ADD",
                "access_binding": {
                  "role_id": "managed-clickhouse.editor",
                  "subject": {
                    "id": "<service_account_ID>",
                    "type": "serviceAccount"
                  }
                }
              }
            ]
          }' \
      mdb.api.cloud.yandex.net:443 \
      yandex.cloud.mdb.clickhouse.v1.ClusterService.UpdateAccessBindings
    

    access_binding_deltas.subject.id: ID of the service account the role is assigned to.

  5. Check the list of roles assigned for the folder:

    grpcurl \
      -format json \
      -import-path ~/cloudapi/ \
      -import-path ~/cloudapi/third_party/googleapis/ \
      -proto ~/cloudapi/yandex/cloud/resourcemanager/v1/folder_service.proto \
      -rpc-header "Authorization: Bearer $IAM_TOKEN" \
      -d '{
            "resource_id": "<folder_ID>"
          }' \
      resource-manager.api.cloud.yandex.net:443 \
      yandex.cloud.resourcemanager.v1.FolderService.ListAccessBindings
    
  6. Check the list of roles assigned for the cluster:

    grpcurl \
      -format json \
      -import-path ~/cloudapi/ \
      -import-path ~/cloudapi/third_party/googleapis/ \
      -proto ~/cloudapi/yandex/cloud/mdb/clickhouse/v1/cluster_service.proto \
      -rpc-header "Authorization: Bearer $IAM_TOKEN" \
      -d '{
            "resource_id": "<cluster_ID>"
          }' \
      mdb.api.cloud.yandex.net:443 \
      yandex.cloud.mdb.clickhouse.v1.ClusterService.ListAccessBindings
    

Was the article helpful?

Previous
Managing backups
Next
Deleting a cluster
© 2026 Direct Cursus Technology L.L.C.