Configuring a federated user group mapping
To configure user access to Yandex Cloud resources using group mapping:
-
Create user groups in Cloud Organization.
-
Configure access rights to Yandex Cloud resources.
-
Create user groups in your identity provider and add users to them.
Note
You can use existing user groups.
-
Set up user group mapping in the identity provider's SAML attribute settings. To learn how to do this, consult the identity provider's documentation or contact their support.
Identity providers offer guides on how to set up group mapping:
-
Set up user group mapping in the federation settings:
Cloud Center interfaceTerraform-
Log in to Yandex Cloud Organization
with an administrator or organization owner account. -
In the left-hand panel, select
Federations. -
Click the line with the required federation and go to the IdP group tab.
-
Enable Mapping group in IdP.
-
Click Add group and configure mapping:
- Group name: Enter the name of an identity provider group.
- IAM group: Select a Cloud Organization group from the list.
-
Repeat the previous step for each group you want to map.
-
Click Save.
With Terraform
, you can quickly create a cloud infrastructure in Yandex Cloud and manage it using configuration files. These files store the infrastructure description written in HashiCorp Configuration Language (HCL). If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.Terraform is distributed under the Business Source License
. The Yandex Cloud provider for Terraform is distributed under the MPL-2.0 license.For more information about the provider resources, see the documentation on the Terraform
website or mirror website.If you do not have Terraform yet, install it and configure its Yandex Cloud provider.
-
In the Terraform configuration file, define the parameters of the resources you want to create:
# Enabling federated user group mapping resource "yandex_organizationmanager_group_mapping" "my_group_map" { federation_id = "<federation_ID>" enabled = true } # Configuring a federated user group mapping resource "yandex_organizationmanager_group_mapping_item" "group_mapping_item" { federation_id = "<federation_ID>" internal_group_id = "<Cloud_Organization_group>" external_group_id = "<identity_provider_group>" depends_on = [yandex_organizationmanager_group_mapping.my_group_map] } resource "yandex_organizationmanager_group_mapping_item" "group_mapping_item-2" { federation_id = "<federation_ID>" internal_group_id = "<Cloud_Organization_group>" external_group_id = "<identity_provider_group>" depends_on = [yandex_organizationmanager_group_mapping.my_group_map] }
Where:
federation_id
: Federation ID.internal_group_id
: Cloud Organization group name.external_group_id
: Name of an identity provider group.
For more information about the
yandex_organizationmanager_group_mapping_item
resource parameters, see the relevant Terraform documentation . -
Create the resources:
-
In the terminal, change to the folder where you edited the configuration file.
-
Make sure the configuration file is correct using the command:
terraform validate
If the configuration is correct, the following message is returned:
Success! The configuration is valid.
-
Run the command:
terraform plan
The terminal will display a list of resources with parameters. No changes are made at this step. If the configuration contains errors, Terraform will point them out.
-
Apply the configuration changes:
terraform apply
-
Confirm the changes: type
yes
in the terminal and press Enter.
Terraform will create all the required resources. You can check resource availability in Yandex Cloud Organization
. -
-