Перейти к основному содержимому
Аутентификация Servercore-провайдера

Аутентификация Servercore-провайдера

Use the Servercore provider to manage Servercore products.

To manage resources available via OpenStack API, use OpenStack Terraform provider.

Example Usage

terraform {
required_providers {
servercore = {
source = "terraform.servercore.com/servercore/servercore"
version = "~> 6.0.0"
}
}
}

# Create a project
resource "servercore_project_v2" "project_1" {
...
}

Authentication (6.0.0 and later)

# Configure the Servercore provider

provider "servercore" {
domain_name = "123456"
username = "user"
password = "password"
auth_region = "pool"
auth_url = "https://cloud.api.servercore.com/identity/v3/"
}

Argument Reference (6.0.0 and later)

  • domain_name — (Required) Servercore account ID. The account ID is in the top right corner of the Control panel. For import, use the value in the OS_DOMAIN_NAME environment variable. Learn more about Registration.

  • username — (Required) Name of the service user. To get the name, in the Control panel, go to Identity & Access ManagementUser management ⟶ the Service users tab ⟶ copy the name of the required user. For import, use the value in the OS_USERNAME environment variable. Learn more about Service users and how to create a service user.

  • password — (Required, Sensitive) Password of the service user. For import, use the value in the OS_PASSWORD environment variable.

  • auth_url- (Required) Keystone Identity authentication URL for authentication via user credentials. For import, use the value in the OS_AUTH_URL environment variable.

  • auth_region — (Required) Pool where the endpoint for Keystone API and Resell API is located. For import, use the value in the OS_REGION_NAME environment variable. Learn more about available pools in the Availability matrix.

  • user_domain_name — (Optional) Servercore account ID. Use only for users that were created and assigned a role in a different account. Applicable only to public cloud. The account ID is in the top right corner of the Control panel. For import, use the value in the OS_USER_DOMAIN_NAME environment variable.

  • project_id — (Optional) Unique identifier of the project. Use only to import resources that are associated with the specific project. To get the ID, in the Control panel, go to the product section in the navigation menu ⟶ project name ⟶ copy the ID of the required project. As an alternative, you can retrieve project ID from the servercore_project_v2 resource. If skipped, use the INFRA_PROJECT_ID environment variable. Learn more about Projects.

  • region — (Optional) Pool, for example, ru-3. Use only to import resources from the specific pool. If skipped, use the INFRA_REGION environment variable. Learn more about available pools in the Availability matrix.