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

selectel_dbaas_prometheus_metric_token_v1

к сведению

Эта инструкция — копия документации Selectel Terraform-провайдера в Terraform Registry.

Creates and manages tokens required to get access to the metrics in the Prometheus format using public API v1. For more information about export of Prometheus metrics, see the official Selectel documentation for PostgreSQL, PostgreSQL for 1C, PostgreSQL TimescaleDB, MySQL semi-sync, MySQL sync, Redis, and Kafka.

Example Usage

resource "selectel_dbaas_prometheus_metric_token_v1" "token_1" {
project_id = selectel_vpc_project_v2.project_1.id
region = "ru-3"
name = "token"
}

Argument Reference

  • project_id - (Required) Unique identifier of the associated project. Changing this creates a new token. Retrieved from the selectel_vpc_project_v2 resource. Learn more about Projects.

  • region - (Required) Pool where the database is located, for example, ru-3. Changing this creates a new token. Learn more about available pools in the Availability matrix.

  • name - (Required) Token name. Changing this creates a new token.

Attributes Reference

  • value (Sensitive) - Token value.

Import

You can import a token:

export OS_DOMAIN_NAME=<account_id>
export OS_USERNAME=<username>
export OS_PASSWORD=<password>
export SEL_PROJECT_ID=<selectel_project_id>
export SEL_REGION=<selectel_pool>
terraform import selectel_dbaas_prometheus_metric_token_v1.token_1 <token_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 ManagementUser management ⟶ the Service users tab ⟶ copy the name of the required user. Learn more about Service users.

  • <password> — Password of the service user.

  • <selectel_project_id> — Unique identifier of the associated project. To get the ID, in the Control panel, go to Cloud Platform ⟶ project name ⟶ copy the ID of the required project. Learn more about Projects.

  • <selectel_pool> — Pool where the cluster is located, for example, ru-3. To get information about the pool, in the Control panel, go to Cloud PlatformManaged Databases. The pool is in the Pool column.

  • <token_id> — Unique identifier of the token, for example, b311ce58-2658-46b5-b733-7a0f418703f2. To get the token ID in the Control panel, go to Cloud PlatformManaged Databases ⟶ the cluster page ⟶ Monitoring tab ⟶ Metrics in the Prometheus format section ⟶ Manage tokens.