Skip to content

Commit

Permalink
Add missing documentation for mysql_ti_config
Browse files Browse the repository at this point in the history
  • Loading branch information
boltandrke committed Aug 22, 2022
1 parent a7b8c1f commit 611cedc
Showing 1 changed file with 113 additions and 0 deletions.
113 changes: 113 additions & 0 deletions website/docs/r/ti_config.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
---
layout: "mysql"
page_title: "MySQL: mysql_ti_config"
sidebar_current: "docs-mysql-resource-ti-config-variable"
description: |-
Manages a TiKV or PD variables on a TiDB cluster.
---

# mysql\_ti\_config

The ``mysql_ti_config`` resource manages a TiKV or PD variables on a TiDB cluster.

~> **Note on TiDB:** Possible TiKV or PD variables are available [here](https://docs.pingcap.com/tidb/stable/dynamic-config)

~> **Note about `destroy`:** `destroy` is trying restore default values as described [here](https://github.com/petoju/terraform-provider-mysql/blob/master/mysql/resource_ti_config_defaults.go).
Unfortunately not every variable support this.

## Example Usage

### PD

```hcl
resource "mysql_ti_config" "log_level" {
name = "log.level"
value = "warn"
type = "pd"
}
```

#### Set variable for all PD instances

```hcl
resource "mysql_ti_config" "log_level" {
name = "log.level"
value = "warn"
type = "pd"
}
```

#### Set variable for one PD instance only

```hcl
resource "mysql_ti_config" "log_level" {
name = "log.level"
value = "warn"
type = "pd"
instance = "127.0.0.1:2379"
}
```

## TiKV

### Set varibale for all TiKV instances

```hcl
resource "mysql_ti_config" "split_qps_threshold" {
name = "split.qps-threshold"
value = "100"
type = "tikv"
}
```

#### Set variable for one TiKV instance only

```hcl
resource "mysql_ti_config" "split_qps_threshold" {
name = "split.qps-threshold"
value = "10"
type = "tikv"
instance = "127.0.0.1:20180"
}
```

## Argument Reference

The following arguments are supported:

* `name` - (Required) The name of the configuration variable.
* `value` - (Required) The value of the configuration variable as string.
* `type` - (Required) The instance type to configure. Possible values are tikv or pd.

## Attributes Reference

No further attributes are exported.

## Import

TiKV or PD variable can be imported using global variable name.

General template to import is

```terraform import mysql_ti_config.<tf_name> <pd|tikv#config#optional_instance_name>```
```terraform import mysql_ti_config.<tf_config_name_in_tf_file> <pd|tikv#config_param_to_read#optional_instance_name>```

### Simple example

#### TiKV example

```shell
terraform import 'mysql_ti_config.split_qps_threshold' 'tikv#split-qps-threshold'
```

Import value for specific instance

```shell
terraform import 'mysql_ti_config.split_qps_threshold' 'tikv#split-qps-threshold#127.0.0.1:20180'
```

#### PD example

```shell
terraform import 'mysql_ti_config.log_level' 'pd#log.level'
```

0 comments on commit 611cedc

Please sign in to comment.