---
title: "Resource selectel_iam_user_v1"
sidebar_label: "selectel_iam_user_v1"
description: "Creates and manages a control panel user or a federated user for Selectel products using public API v1"
sidebar_position: 27
---

# Resource selectel\_iam\_user\_v1

:::info

This instruction is a copy of the Selectel Terraform provider documentation in the [Terraform Registry](https://registry.terraform.io/providers/selectel/selectel/latest/docs).

:::

Creates and manages a control panel (local) user or a federated user using public API v1. Selectel products support Identity and Access Management (IAM). For more information about users, see the [official Selectel documentation](/access-control/access-management/).

## Example usage \{#example-usage}

```hcl
resource "selectel_iam_user_v1" "user_1" {
  email       = "mail@example.com"
  role {
    role_name = "member"
    scope     = "account"
  }
}
```

## Argument reference \{#argument-reference}

* `email` — (Required) User email address. Changing this creates a new user. We will send authentication instructions to this email.

* `auth_type` — (Optional) User authentication type. Changing this creates a new user. Available types are `local` (for control panel users, to store credentials locally in Selectel) and `federated` (for federated users, to store credentials in the corporate Identity Provider). The default value is `local`. If `auth_type` is `federated`, the `federation` argument is required.

* `federation` — (Optional) Information about the federation. `auth_type` must be set to `federated`.

  * `id` — (Required) Unique identifier of the federation.

  * `external_id` — (Required) Unique user identifier assigned by the Identity Provider.

* `role` — (Optional) Manages service user roles. You can add multiple roles—each role in a separate block.

  * `role_name` — (Required) Role name.

  * `scope` — (Required) Role scope. Available scopes are `account` and `project`. If `scope` is `project`, the `project_id` argument is required.

  * `project_id` — (Optional) Unique identifier of the associated project. Changing this creates a new service user. If `scope` is `project`, the `project_id` argument is required. Retrieved from the [selectel\_vpc\_project\_v2](/terraform/selectel-provider-reference/resources/vpc_project_v2/) resource. Learn more about [Projects](/access-control/projects/about-projects/).

## Attributes reference \{#attributes-reference}

* `keystone_id` — Unique Keystone identifier of the user.

## Import \{#import}

You can import a user:

```shell
export OS_DOMAIN_NAME=<account_id>
export OS_USERNAME=<username>
export OS_PASSWORD=<password>
terraform import selectel_iam_user_v1.user_1 <user_id>
```

where:

* `<account_id>` — Selectel account ID. The account ID is in the top right corner of the [Control panel](https://my.selectel.ru/). Learn more about [Registration](/account/registration/).

* `<username>` — Service user name. To get the name, in the [Control panel](https://my.selectel.ru/iam/users_management/users?type=service), go to **Identity & Access Management** ⟶ **User management** ⟶ the **Service users** tab ⟶ copy the name of the required user. Learn more about [Service Users](/access-control/access-management/).

* `<password>` — Service user password.

* `<user_id>` — Unique identifier of the user to import (not the Keystone ID), for example, `123456_5432`. To get the user ID, use either [iam-go](https://github.com/selectel/iam-go) or [IAM API](/api/users-and-roles/).
