Перейти к основному содержимому
selectel_vpc_keypair_v2
Последнее изменение:

selectel_vpc_keypair_v2

Creates and manages a SSH key pair using public API v2. For more information about SSH key pairs, see the official Selectel documentation.

Selectel products support Identity and Access Management (IAM). Only service users can use SSH key pairs. To create a service user, use the selectel_vpc_user_v2 resource. For more information about service users, see the official Selectel documentation.

Example Usage

resource "selectel_vpc_keypair_v2" "keypair_1" {
name = "keypair"
public_key = file("~/.ssh/id_rsa.pub")
user_id = selectel_vpc_user_v2.user_1.id
}

Argument Reference

  • name - (Required) Name of the SSH key pair. Changing this creates a new key pair.

  • public_key - (Required) Pregenerated OpenSSH-formatted public key. Changing this creates a new key pair. Learn more how to create SSH key pair.

  • user_id - (Required) Unique identifier of the associated service user. Changing this creates a new key pair. Retrieved from the selectel_vpc_user_v2 resource.

  • regions - (Optional) List of pools where the key pair is located, for example, ru-3. Changing this creates a new key pair. Learn more about available pools in the Availability matrix.

Import

You can import a SSH key pair:

export OS_DOMAIN_NAME=<account_id>
export OS_USERNAME=<username>
export OS_PASSWORD=<password>
terraform import selectel_vpc_keypair_v2.keypair_1 <user_id>/<keypair_name>

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 top right corner of the Control panel, go to the account menu ⟶ Profile and SettingsUser 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 associated service user, for example, abc1bb378ac84e1234b869b77aadd2ab. To get the ID, in the top right corner of the Control panel, go to the account menu ⟶ Profile and SettingsUser management ⟶ the Service users tab ⟶ copy the name of the required user.

  • <keypair_name> — Name of the key pair, for example, Key. To get the name, in the top right corner of the Control panel, go to the account menu ⟶ Profile and SettingsUser management ⟶ the Service users tab ⟶ the user page. The SSH key pair name is in the SSH keys section.