|
1 | 1 | --- |
2 | | -layout: "mysql" |
3 | | -page_title: "MySQL: mysql_ti_config" |
4 | | -sidebar_current: "docs-mysql-resource-ti-config-variable" |
| 2 | +# generated by https://github.com/hashicorp/terraform-plugin-docs |
| 3 | +page_title: "mysql_ti_config Resource - terraform-provider-mysql" |
| 4 | +subcategory: "" |
5 | 5 | description: |- |
6 | | - Manages a TiKV or PD variables on a TiDB cluster. |
| 6 | + |
7 | 7 | --- |
8 | 8 |
|
9 | | -# mysql\_ti\_config |
| 9 | +# mysql_ti_config (Resource) |
10 | 10 |
|
11 | | -The ``mysql_ti_config`` resource manages a TiKV or PD variables on a TiDB cluster. |
12 | 11 |
|
13 | | -~> **Note on TiDB:** Possible TiKV or PD variables are available [here](https://docs.pingcap.com/tidb/stable/dynamic-config) |
14 | 12 |
|
15 | | -~> **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). |
16 | | - Unfortunately not every variable support this. |
17 | 13 |
|
18 | | -## Example Usage |
19 | 14 |
|
20 | | -### PD |
| 15 | +<!-- schema generated by tfplugindocs --> |
| 16 | +## Schema |
21 | 17 |
|
22 | | -```hcl |
23 | | -resource "mysql_ti_config" "log_level" { |
24 | | - name = "log.level" |
25 | | - value = "warn" |
26 | | - type = "pd" |
27 | | -} |
28 | | -``` |
| 18 | +### Required |
29 | 19 |
|
30 | | -#### Set variable for all PD instances |
| 20 | +- `name` (String) |
| 21 | +- `type` (String) |
| 22 | +- `value` (String) |
31 | 23 |
|
32 | | -```hcl |
33 | | -resource "mysql_ti_config" "log_level" { |
34 | | - name = "log.level" |
35 | | - value = "warn" |
36 | | - type = "pd" |
37 | | -} |
38 | | -``` |
| 24 | +### Optional |
39 | 25 |
|
40 | | -#### Set variable for one PD instance only |
| 26 | +- `instance` (String) |
41 | 27 |
|
42 | | -```hcl |
43 | | -resource "mysql_ti_config" "log_level" { |
44 | | - name = "log.level" |
45 | | - value = "warn" |
46 | | - type = "pd" |
47 | | - instance = "127.0.0.1:2379" |
48 | | -} |
49 | | -``` |
| 28 | +### Read-Only |
50 | 29 |
|
51 | | -## TiKV |
52 | | - |
53 | | -### Set varibale for all TiKV instances |
54 | | - |
55 | | -```hcl |
56 | | -resource "mysql_ti_config" "split_qps_threshold" { |
57 | | - name = "split.qps-threshold" |
58 | | - value = "100" |
59 | | - type = "tikv" |
60 | | -} |
61 | | -``` |
62 | | - |
63 | | -#### Set variable for one TiKV instance only |
64 | | - |
65 | | -```hcl |
66 | | -resource "mysql_ti_config" "split_qps_threshold" { |
67 | | - name = "split.qps-threshold" |
68 | | - value = "10" |
69 | | - type = "tikv" |
70 | | - instance = "127.0.0.1:20180" |
71 | | -} |
72 | | -``` |
73 | | - |
74 | | -## Argument Reference |
75 | | - |
76 | | -The following arguments are supported: |
77 | | - |
78 | | -* `name` - (Required) The name of the configuration variable. |
79 | | -* `value` - (Required) The value of the configuration variable as string. |
80 | | -* `type` - (Required) The instance type to configure. Possible values are tikv or pd. |
81 | | - |
82 | | -## Attributes Reference |
83 | | - |
84 | | -No further attributes are exported. |
85 | | - |
86 | | -## Import |
87 | | - |
88 | | -TiKV or PD variable can be imported using global variable name. |
89 | | - |
90 | | -General template to import is |
91 | | - |
92 | | -```terraform import mysql_ti_config.<tf_name> <pd|tikv#config#optional_instance_name>``` |
93 | | -```terraform import mysql_ti_config.<tf_config_name_in_tf_file> <pd|tikv#config_param_to_read#optional_instance_name>``` |
94 | | - |
95 | | -### Simple example |
96 | | - |
97 | | -#### TiKV example |
98 | | - |
99 | | -```shell |
100 | | -terraform import 'mysql_ti_config.split_qps_threshold' 'tikv#split-qps-threshold' |
101 | | -``` |
102 | | - |
103 | | -Import value for specific instance |
104 | | - |
105 | | -```shell |
106 | | -terraform import 'mysql_ti_config.split_qps_threshold' 'tikv#split-qps-threshold#127.0.0.1:20180' |
107 | | -``` |
108 | | - |
109 | | -#### PD example |
110 | | - |
111 | | -```shell |
112 | | -terraform import 'mysql_ti_config.log_level' 'pd#log.level' |
113 | | -``` |
| 30 | +- `id` (String) The ID of this resource. |
0 commit comments