Assigning a user as an organization administrator
- Log in to Yandex Identity Hub
using an administrator or organization owner account. - In the left-hand panel, select
Access bindings. - At the top right, click Assign roles.
- Select the user you want to assign as an administrator. If required, use the search bar.
- Click
Add role and selectorganization-manager.admin. - Click Save.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
-
Assign a role using this command:
yc organization-manager organization add-access-binding <organization_name_or_ID> \ --role <role_ID> \ --user-account-id <user_ID>Where:
--role: Role ID. Specify theorganization-manager.adminrole.--user-account-id: User ID. You can also use the--user-yandex-loginparameter and specify the username instead of the ID.
For example, this command assigns the administrator role for the organization with the
bpf3crucp1v2********ID:yc organization-manager organization add-access-binding bpf3crucp1v2******** \ --role organization-manager.admin \ --user-account-id aje6o61dvog2********
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
To manage infrastructure using Terraform under a service account or user accounts (a Yandex account, a federated account, or a local user), authenticate using the appropriate method.
-
Describe the parameters of the roles you assign in the configuration file:
resource "yandex_organizationmanager_organization_iam_binding" "org_admin_role" { organization_id = "<organization_ID>" role = "organization-manager.admin" member = "userAccount:<user_ID>" }Where:
-
organization_id: Organization ID. -
role: Specify theorganization-manager.adminrole. For each role, you can only use oneyandex_organizationmanager_organization_iam_bindingresource. -
member: Subject getting the role.Subject designations
To indicate a subject, use a combination of its type and unique ID, i.e.,
<subject_type>:<ID>. How you can designate a subject:Subject type
Subject designation
userAccountuserAccount:<user_ID>serviceAccountserviceAccount:<service_account_ID>federatedUserfederatedUser:<user_ID>groupgroup:<group_ID>systemsystem:allAuthenticatedUsers(
All authenticated usersgroup)system:allUsers(
All usersgroup)system:group:organization:<organization_ID>:users(
All users in organization Xgroup)system:group:federation:<federation_ID>:users(
All users in federation Ngroup)system:group:userpool:<pool_ID>:users(
All users in userpool Pgroup)
For more on the properties of the
yandex_organizationmanager_organization_iam_bindingresource, see this provider guide. -
-
Create the resources:
-
In the terminal, navigate to the configuration file directory.
-
Make sure the configuration is correct using this command:
terraform validateIf the configuration is valid, you will get this message:
Success! The configuration is valid. -
Run this command:
terraform planYou will see a list of resources and their properties. No changes will be made at this step. Terraform will show any errors in the configuration.
-
Apply the configuration changes:
terraform apply -
Type
yesand press Enter to confirm the changes.
-
The user will thus be assigned the organization administrator role. You can check the role assignment using the Cloud Center UI
To assign a user the organization administrator role, use the updateAccessBindings REST API method for the Organization resource or the OrganizationService/UpdateAccessBindings gRPC API call and provide the following in the request:
-
ADDvalue in theaccessBindingDeltas[].actionparameter to add a role. -
Role in the
accessBindingDeltas[].accessBinding.roleIdparameter. -
ID of the subject getting the role in the
accessBindingDeltas[].accessBinding.subject.idparameter. -
Type of the subject getting the role in the
accessBindingDeltas[].accessBinding.subject.typeparameter.Subject designations
To indicate a subject, use a combination of its type and unique ID in the
subject.typeandsubject.idfields of the request. Possible combinations:subject.type
subject.id
userAccount<user_ID>serviceAccount<service_account_ID>federatedUser<user_ID>group<group_ID>systemallAuthenticatedUsers(
All authenticated usersgroup)allUsers(
All usersgroup)group:organization:<organization_ID>:users(
All users in organization Xgroup)group:federation:<federation_ID>:users(
All users in federation Ngroup)group:userpool:<pool_ID>:users(
All users in userpool Pgroup)