selectel_iam_user_v1
Эта инструкция — копия документации Selectel Terraform-провайдера в Terraform Registry.
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.
Example Usage
resource "selectel_iam_user_v1" "user_1" {
email = "mail@example.com"
role {
role_name = "member"
scope = "account"
}
}
Argument Reference
-
email
- (Required) Email address of the user. Changing this creates a new user. We will send authentication instructions to this email. -
auth_type
- (Optional) Authentication type of the user. Changing this creates a new user. Available types arelocal
(for control panel users, to store the credentials locally in Selectel) andfederated
(for federated users, to store the credentials in the corporate Identity Provider). The default value islocal
. Ifauth_type
isfederated
, thefederation
argument is required. -
federation
- (Optional) Information about the federation.auth_type
must be set tofederated
.-
id
- (Required) Unique identifier of the federation. -
external_id
- (Required) Unique identifier of the user assigned by the Identity Provider.
-
-
role
- (Optional) Manages service user roles. You can add multiple roles – each role in a separate block. For more information about roles, see the Roles section.-
role_name
- (Required) Role name. Available role names areiam_admin
,member
,reader
, andbilling
. -
scope
- (Required) Scope of the role. Available scopes areaccount
andproject
. Ifscope
isproject
, theproject_id
argument is required. -
project_id
- (Optional) Unique identifier of the associated project. Changing this creates a new service user. Ifscope
isproject
, theproject_id
argument is required. Retrieved from the selectel_vpc_project_v2 resource. Learn more about Projects.
-
Roles
To assign roles, use the following values for scope
and role_name
:
-
Account administrator -
scope
isaccount
,role_name
ismember
. -
Billing administrator -
scope
isaccount
,role_name
isbilling
. -
User administrator -
scope
isaccount
,role_name
isiam_admin
. -
Project administrator -
scope
isproject
,role_name
ismember
. -
Account viewer -
scope
isaccount
,role_name
isreader
. -
Project viewer -
scope
isproject
,role_name
isreader
. -
Object storage admin -
scope
isproject
,role_name
isobject_storage:admin
. -
Object storage user -
scope
isproject
,role_name
isobject_storage_user
.
Attributes Reference
keystone_id
- Unique Keystone identifier of the user.
Import
You can import a user:
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. Learn more about Registration. -
<username>
— Name of the service user. To get the name, in the Control panel, go to Identity & Access Management ⟶ User management ⟶ the Service users tab ⟶ copy the name of the required user. Learn more about Service Users. -
<password>
— Password of the service user. -
<user_id>
— Unique identifier of the user to import (not the Keystone ID), for example,123456_5432
. To get the ID, use either iam-go or IAM API.