Skip to content

Commit 1116897

Browse files
authored
chore: update instance engine types (#58)
* chore: update instance engine types * chore: update
1 parent 9773552 commit 1116897

24 files changed

+654
-548
lines changed

api/common.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,18 @@ const (
2828
EngineTypeMongoDB EngineType = "MONGODB"
2929
// EngineTypeSQLite is the database type for SQLite.
3030
EngineTypeSQLite EngineType = "SQLITE"
31+
// EngineTypeRedis is the database type for REDIS.
32+
EngineTypeRedis EngineType = "REDIS"
33+
// EngineTypeOracle is the database type for ORACLE.
34+
EngineTypeOracle EngineType = "ORACLE"
35+
// EngineTypeSpanner is the database type for SPANNER.
36+
EngineTypeSpanner EngineType = "SPANNER"
37+
// EngineTypeMSSQL is the database type for MSSQL.
38+
EngineTypeMSSQL EngineType = "MSSQL"
39+
// EngineTypeRedshift is the database type for REDSHIFT.
40+
EngineTypeRedshift EngineType = "REDSHIFT"
41+
// EngineTypeMariaDB is the database type for MARIADB.
42+
EngineTypeMariaDB EngineType = "MARIADB"
43+
// EngineTypeOceanbase is the database type for OCEANBASE.
44+
EngineTypeOceanbase EngineType = "OCEANBASE"
3145
)

docs/assets/overview.webp

-62 KB
Binary file not shown.

docs/data-sources/database.md

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,25 @@ description: |-
88

99
# bytebase_database (Data Source)
1010

11-
The database data source. You can get a single database through `bytebase_database` data source.
11+
The database data source.
1212

13-
## Example Usage
1413

15-
```terraform
16-
# Find a database by it's name and instance resource id.
17-
data "bytebase_database" "employee" {
18-
name = "employee"
19-
instance = "postgres-sample"
20-
}
21-
22-
output "employee_databases" {
23-
value = data.bytebase_database.employee
24-
}
25-
```
26-
27-
You can check [examples](https://github.com/bytebase/terraform-provider-bytebase/blob/main/examples/databases) for more usage examples.
2814

2915
<!-- schema generated by tfplugindocs -->
30-
3116
## Schema
3217

3318
### Required
3419

20+
- `instance` (String) The instance resource id for the database.
3521
- `name` (String) The database name.
36-
- `instance` (String) The instance unique resource id.
3722

3823
### Read-Only
3924

40-
- `project` (String) The project unique resource id.
25+
- `id` (String) The ID of this resource.
4126
- `labels` (Map of String) The deployment and policy control labels.
42-
- `sync_state` (String) The existence of a database on latest sync.
43-
- `successful_sync_time` (String) The latest synchronization time.
27+
- `project` (String) The project for a database with projects/{project} format.
4428
- `schema_version` (String) The version of database schema.
29+
- `successful_sync_time` (String) The latest synchronization time.
30+
- `sync_state` (String) The existence of a database on latest sync.
31+
32+

docs/data-sources/database_list.md

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,46 +8,34 @@ description: |-
88

99
# bytebase_database_list (Data Source)
1010

11-
The database data source list. You can list databases through `bytebase_database_list` data source.
11+
The database data source list.
1212

13-
## Example Usage
1413

15-
```terraform
16-
# List all databases in all instances
17-
data "bytebase_database_list" "all" {
18-
}
19-
20-
output "all_databases" {
21-
value = data.bytebase_database_list.all
22-
}
23-
24-
# List all databases with project filter
25-
data "bytebase_database_list" "sample" {
26-
project = "project-sample"
27-
}
28-
29-
output "databases_in_sample_project" {
30-
value = data.bytebase_database_list.sample
31-
}
32-
```
33-
34-
You can check [examples](https://github.com/bytebase/terraform-provider-bytebase/blob/main/examples/databases) for more usage examples.
3514

3615
<!-- schema generated by tfplugindocs -->
37-
3816
## Schema
3917

4018
### Optional
4119

42-
- `instance` (String) The instance unique resource id.
43-
- `project` (String) The project unique resource id.
20+
- `instance` (String) The instance resource id for the database. You can use "-" to list databases in all instances.
21+
- `project` (String) The project resource id for the database. You can use "-" to list databases in all projects.
4422

4523
### Read-Only
4624

4725
- `databases` (List of Object) (see [below for nested schema](#nestedatt--databases))
26+
- `id` (String) The ID of this resource.
4827

4928
<a id="nestedatt--databases"></a>
50-
5129
### Nested Schema for `databases`
5230

53-
See [Databases Schema](https://registry.terraform.io/providers/bytebase/bytebase/latest/docs/data-sources/database#schema).
31+
Read-Only:
32+
33+
- `instance` (String)
34+
- `labels` (Map of String)
35+
- `name` (String)
36+
- `project` (String)
37+
- `schema_version` (String)
38+
- `successful_sync_time` (String)
39+
- `sync_state` (String)
40+
41+

docs/data-sources/environment.md

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,22 @@ description: |-
88

99
# bytebase_environment (Data Source)
1010

11-
The environment data source. You can get a single environment through `bytebase_environment` data source.
11+
The environment data source.
1212

13-
## Example Usage
1413

15-
```terraform
16-
# Get environment by resource id
17-
data "bytebase_environment" "dev" {
18-
resource_id = "dev"
19-
}
20-
21-
output "env" {
22-
value = data.bytebase_environment.dev
23-
}
24-
```
25-
26-
You can check [examples](https://github.com/bytebase/terraform-provider-bytebase/blob/main/examples/environments) for more usage examples.
2714

2815
<!-- schema generated by tfplugindocs -->
29-
3016
## Schema
3117

3218
### Required
3319

34-
- `resource_id` (String) The environment **unique resource id**.
20+
- `resource_id` (String) The environment unique resource id.
3521

3622
### Read-Only
3723

38-
- `id` (Number) The ID of this resource.
39-
- `title` (String) The environment **unique** name.
40-
- `order` (Number) The environment sorting order. Starting with 1. Lower number appears first in the deployment pipeline.
41-
- `environment_tier_policy` (String) Check [Environment Tier](https://www.bytebase.com/docs/administration/environment-policy/tier) for details. Should be one of:
42-
- `PROTECTED`
43-
- `UNPROTECTED`
24+
- `environment_tier_policy` (String) If marked as PROTECTED, developers cannot execute any query on this environment's databases using SQL Editor by default.
25+
- `id` (String) The ID of this resource.
26+
- `order` (Number) The environment sorting order.
27+
- `title` (String) The environment unique name.
28+
29+

docs/data-sources/environment_list.md

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,30 @@ description: |-
88

99
# bytebase_environment_list (Data Source)
1010

11-
The environment data source list. You can list environments through `bytebase_environment_list` data source.
11+
The environment data source list.
1212

13-
## Example Usage
1413

15-
```terraform
16-
# List environments
17-
data "bytebase_environment_list" "all" {}
18-
19-
output "all_environments" {
20-
value = data.bytebase_environment_list.all.environments
21-
}
22-
```
23-
24-
You can check [examples](https://github.com/bytebase/terraform-provider-bytebase/blob/main/examples/environments) for more usage examples.
2514

2615
<!-- schema generated by tfplugindocs -->
27-
2816
## Schema
2917

3018
### Optional
3119

32-
- `show_deleted` (Boolean) If also show the deleted environments.
20+
- `show_deleted` (Boolean) Including removed instance in the response.
3321

3422
### Read-Only
3523

3624
- `environments` (List of Object) (see [below for nested schema](#nestedatt--environments))
25+
- `id` (String) The ID of this resource.
3726

3827
<a id="nestedatt--environments"></a>
39-
4028
### Nested Schema for `environments`
4129

42-
See [Environment Schema](https://registry.terraform.io/providers/bytebase/bytebase/latest/docs/data-sources/environment#schema).
30+
Read-Only:
31+
32+
- `environment_tier_policy` (String)
33+
- `order` (Number)
34+
- `resource_id` (String)
35+
- `title` (String)
36+
37+

docs/data-sources/instance.md

Lines changed: 17 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,62 +8,36 @@ description: |-
88

99
# bytebase_instance (Data Source)
1010

11-
The instance data source. You can get a single instance through `bytebase_instance` data source.
11+
The instance data source.
1212

13-
## Example Usage
1413

15-
```terraform
16-
# Find a instance by resource id "dev-instance" in the "dev" environment.
17-
data "bytebase_instance" "dev" {
18-
resource_id = "dev-instance"
19-
}
20-
21-
output "instance" {
22-
value = data.bytebase_instance.dev
23-
}
24-
```
25-
26-
You can check [examples](https://github.com/bytebase/terraform-provider-bytebase/blob/main/examples/instances) for more usage examples.
2714

2815
<!-- schema generated by tfplugindocs -->
29-
3016
## Schema
3117

3218
### Required
3319

34-
- `resource_id` (String) The instance **unique resource id**.
20+
- `resource_id` (String) The instance unique resource id.
3521

3622
### Read-Only
3723

38-
- `id` (Number) The instance id.
39-
- `title` (String) The instance name.
40-
- `engine` (String) The instance engine. Should be one of:
41-
- `MYSQL`
42-
- `POSTGRES`
43-
- `TIDB`
44-
- `SNOWFLAKE`
45-
- `CLICKHOUSE`
46-
- `SQLITE`
47-
- `MONGODB`
24+
- `data_sources` (List of Object) (see [below for nested schema](#nestedatt--data_sources))
25+
- `engine` (String) The instance engine. Support MYSQL, POSTGRES, TIDB, SNOWFLAKE, CLICKHOUSE, MONGODB, SQLITE, REDIS, ORACLE, SPANNER, MSSQL, REDSHIFT, MARIADB, OCEANBASE.
26+
- `environment` (String) The environment name for your instance in "environments/{resource id}" format.
4827
- `external_link` (String) The external console URL managing this instance (e.g. AWS RDS console, your in-house DB instance console)
49-
- `data_sources` (List of Object) The connection for the instance. You can configure read-only or admin connection account here. (see [below for nested schema](#nestedblock--data_sources))
50-
- `environment` (String) The environment **unique resource id** for the instance.
51-
52-
<a id="nestedblock--data_sources"></a>
28+
- `id` (String) The ID of this resource.
29+
- `title` (String) The instance title.
5330

31+
<a id="nestedatt--data_sources"></a>
5432
### Nested Schema for `data_sources`
5533

56-
#### Read-Only
34+
Read-Only:
35+
36+
- `database` (String)
37+
- `host` (String)
38+
- `port` (String)
39+
- `title` (String)
40+
- `type` (String)
41+
- `username` (String)
42+
5743

58-
- `title` (String) The unique data source name in this instance.
59-
- `type` (String) The data source type. Should be one of:
60-
- `ADMIN`: The ADMIN type of data source.
61-
- `READ_ONLY`: The read-only type of data source.
62-
- `username` (String) The connection user name used by Bytebase to perform DDL and DML operations.
63-
- `password` (String) The connection user password used by Bytebase to perform DDL and DML operations.
64-
- `ssl_ca` (String) The CA certificate. Optional, you can set this if the engine type is `CLICKHOUSE`.
65-
- `ssl_cert` (String) The client certificate. Optional, you can set this if the engine type is `CLICKHOUSE`.
66-
- `ssl_key` (String) The client key. Optional, you can set this if the engine type is `CLICKHOUSE`.
67-
- `host` (String) Host or socket for the data source, or the account name if the instance type is Snowflake.
68-
- `port` (String) The port for the data source.
69-
- `database` (String) The database for the data source.

docs/data-sources/instance_list.md

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,44 @@ description: |-
88

99
# bytebase_instance_list (Data Source)
1010

11-
The instance data source list. You can list instances through `bytebase_instance_list` data source.
11+
The instance data source list.
1212

13-
## Example Usage
1413

15-
```terraform
16-
# List all instances in all environments
17-
data "bytebase_instance_list" "all" {}
18-
19-
output "all_instances" {
20-
value = data.bytebase_instance_list.all
21-
}
22-
```
23-
24-
You can check [examples](https://github.com/bytebase/terraform-provider-bytebase/blob/main/examples/instances) for more usage examples.
2514

2615
<!-- schema generated by tfplugindocs -->
27-
2816
## Schema
2917

3018
### Optional
3119

32-
- `show_deleted` (Boolean) If also show the deleted instances.
20+
- `show_deleted` (Boolean) Including removed instance in the response.
3321

3422
### Read-Only
3523

24+
- `id` (String) The ID of this resource.
3625
- `instances` (List of Object) (see [below for nested schema](#nestedatt--instances))
3726

3827
<a id="nestedatt--instances"></a>
39-
4028
### Nested Schema for `instances`
4129

42-
See [Instance Schema](https://registry.terraform.io/providers/bytebase/bytebase/latest/docs/data-sources/instance#schema).
30+
Read-Only:
31+
32+
- `data_sources` (List of Object) (see [below for nested schema](#nestedobjatt--instances--data_sources))
33+
- `engine` (String)
34+
- `environment` (String)
35+
- `external_link` (String)
36+
- `resource_id` (String)
37+
- `title` (String)
38+
39+
<a id="nestedobjatt--instances--data_sources"></a>
40+
### Nested Schema for `instances.data_sources`
41+
42+
Read-Only:
43+
44+
- `database` (String)
45+
- `host` (String)
46+
- `port` (String)
47+
- `title` (String)
48+
- `type` (String)
49+
- `username` (String)
4350

44-
### Nested Schema for `data_sources`
4551

46-
See [Data Source Schema](https://registry.terraform.io/providers/bytebase/bytebase/latest/docs/data-sources/instance#nested-schema-for-data_sources).

0 commit comments

Comments
 (0)