Skip to content

Commit 5e93b41

Browse files
authored
chore: update the docs (#43)
* feat: support policy data source * chore: support CRUD policy resource * chore: support config sql review rules * chore: update docs * chore: update version
1 parent 455980d commit 5e93b41

File tree

7 files changed

+583
-8
lines changed

7 files changed

+583
-8
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.7-alpha.3
1+
0.0.7-alpha.4

docs/data-sources/policy.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "bytebase_policy Data Source - terraform-provider-bytebase"
4+
subcategory: ""
5+
description: |-
6+
The policy data source.
7+
---
8+
9+
# bytebase_policy (Data Source)
10+
11+
The policy data source. You can get a single policy through `bytebase_policy` data source.
12+
13+
## Example Usage
14+
15+
```terraform
16+
# Find SQL review policy in test environment.
17+
data "bytebase_policy" "sql_review" {
18+
environment = "test"
19+
type = "SQL_REVIEW"
20+
}
21+
22+
output "sql_review_policy" {
23+
value = data.bytebase_policy.sql_review
24+
}
25+
```
26+
27+
You can check [examples](https://github.com/bytebase/terraform-provider-bytebase/blob/main/examples/policies) for more usage examples.
28+
29+
<!-- schema generated by tfplugindocs -->
30+
31+
## Schema
32+
33+
### Required
34+
35+
#### The policy type
36+
37+
- `type` (String) The policy type. Should be one of:
38+
- `DEPLOYMENT_APPROVAL`
39+
- `BACKUP_PLAN`
40+
- `SENSITIVE_DATA`
41+
- `ACCESS_CONTROL`
42+
- `SQL_REVIEW`
43+
44+
### Optional
45+
46+
#### Locate the policy resource
47+
48+
See [Locate the policy resource](https://registry.terraform.io/providers/bytebase/bytebase/latest/docs/resources/policy#optional) for details.
49+
50+
### Read-Only
51+
52+
#### The policy payload
53+
54+
See [The policy payload](https://registry.terraform.io/providers/bytebase/bytebase/latest/docs/resources/policy#the-policy-payload) for details.

docs/data-sources/policy_list.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "bytebase_policy_list Data Source - terraform-provider-bytebase"
4+
subcategory: ""
5+
description: |-
6+
The policy data source list.
7+
---
8+
9+
# bytebase_policy_list (Data Source)
10+
11+
The policy data source list. You can list policies through `bytebase_policy_list` data source.
12+
13+
## Example Usage
14+
15+
```terraform
16+
# List policies in test environment.
17+
data "bytebase_policy_list" "test_env_policies" {
18+
environment = "test"
19+
}
20+
21+
output "test_env_policies" {
22+
value = data.bytebase_policy_list.test_env_policies
23+
}
24+
```
25+
26+
You can check [examples](https://github.com/bytebase/terraform-provider-bytebase/blob/main/examples/policies) for more usage examples.
27+
28+
<!-- schema generated by tfplugindocs -->
29+
30+
## Schema
31+
32+
### Optional
33+
34+
See [Locate the policy resource](https://registry.terraform.io/providers/bytebase/bytebase/latest/docs/resources/policy#optional) for details.
35+
36+
### Read-Only
37+
38+
- `policies` (List of Object) (see [below for nested schema](#nestedatt--policies))
39+
40+
<a id="nestedatt--policies"></a>
41+
42+
### Nested Schema for `policies`
43+
44+
See [Policy Schema](https://registry.terraform.io/providers/bytebase/bytebase/latest/docs/data-sources/policy#schema).

docs/resources/instance.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,26 @@ resource "bytebase_instance" "dev_instance" {
2929
port = 5432
3030
}
3131
}
32+
33+
# Create another instance with identifier "tidb-instance"
34+
resource "bytebase_instance" "tidb_instance" {
35+
resource_id = "tidb-instance"
36+
title = "tidb instance"
37+
engine = "TIDB"
38+
environment = "dev"
39+
40+
data_source_list {
41+
title = "admin data source"
42+
type = "ADMIN"
43+
username = "<The connection user name>"
44+
password = "<The connection user password>"
45+
host = "127.0.0.1"
46+
port = 4000
47+
ssl_ca = file("ssl_ca_file_path")
48+
ssl_cert = file("ssl_cert_file_path")
49+
ssl_key = file("ssl_key_file_path")
50+
}
51+
}
3252
```
3353

3454
You can check [examples](https://github.com/bytebase/terraform-provider-bytebase/blob/main/examples/setup) for more usage examples.
@@ -77,7 +97,7 @@ You can check [examples](https://github.com/bytebase/terraform-provider-bytebase
7797

7898
- `username` (String) The connection user name used by Bytebase to perform DDL and DML operations.
7999
- `password` (String) The connection user password used by Bytebase to perform DDL and DML operations.
80-
- `ssl_ca` (String) The CA certificate. Optional, you can set this if the engine type is `CLICKHOUSE`.
81-
- `ssl_cert` (String) The client certificate. Optional, you can set this if the engine type is `CLICKHOUSE`.
82-
- `ssl_key` (String) The client key. Optional, you can set this if the engine type is `CLICKHOUSE`.
100+
- `ssl_ca` (String) The CA certificate. Optional, you can set this if the engine type is `MYSQL`, `POSTGRES`, `TIDB` or `CLICKHOUSE`.
101+
- `ssl_cert` (String) The client certificate. Optional, you can set this if the engine type is `MYSQL`, `POSTGRES`, `TIDB` or `CLICKHOUSE`.
102+
- `ssl_key` (String) The client key. Optional, you can set this if the engine type is `MYSQL`, `POSTGRES`, `TIDB` or `CLICKHOUSE`.
83103
- `database` (String) The database for the data source, you can set this if the engine type is `POSTGRES`.

0 commit comments

Comments
 (0)