You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/data-sources/environment.md
+4-11Lines changed: 4 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,9 +13,9 @@ The environment data source. You can get a single environment through `bytebase_
13
13
## Example Usage
14
14
15
15
```terraform
16
-
# Get environment named "dev"
16
+
# Get environment by resource id
17
17
data "bytebase_environment" "dev" {
18
-
name = "dev"
18
+
resource_id = "dev"
19
19
}
20
20
21
21
output "env" {
@@ -31,20 +31,13 @@ You can check [examples](https://github.com/bytebase/terraform-provider-bytebase
31
31
32
32
### Required
33
33
34
-
-`name` (String) The environment unique name.
34
+
-`resource_id` (String) The environment **unique resource id**.
35
35
36
36
### Read-Only
37
37
38
38
-`id` (Number) The ID of this resource.
39
+
-`title` (String) The environment **unique** name.
39
40
-`order` (Number) The environment sorting order. Starting with 1. Lower number appears first in the deployment pipeline.
40
41
-`environment_tier_policy` (String) Check [Environment Tier](https://www.bytebase.com/docs/administration/environment-policy/tier) for details. Should be one of:
41
42
-`PROTECTED`
42
43
-`UNPROTECTED`
43
-
-`pipeline_approval_policy` (String) Check [Approval Policy](https://www.bytebase.com/docs/administration/environment-policy/approval-policy) for details. Should be one of:
44
-
-`MANUAL_APPROVAL_NEVER`
45
-
-`MANUAL_APPROVAL_BY_PROJECT_OWNER`
46
-
-`MANUAL_APPROVAL_BY_WORKSPACE_OWNER_OR_DBA`
47
-
-`backup_plan_policy` (String) Check [Backup Schedule Policy](https://www.bytebase.com/docs/administration/environment-policy/backup-schedule-policy) for details. Should be one of:
Copy file name to clipboardExpand all lines: docs/data-sources/instance.md
+16-14Lines changed: 16 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,9 +13,10 @@ The instance data source. You can get a single instance through `bytebase_instan
13
13
## Example Usage
14
14
15
15
```terraform
16
-
# Find a instance named "dev-instance"
16
+
# Find a instance by resource id "dev-instance" in the "dev" environment.
17
17
data "bytebase_instance" "dev" {
18
-
name = "dev-instance"
18
+
resource_id = "dev-instance"
19
+
environment = "dev"
19
20
}
20
21
21
22
output "instance" {
@@ -31,38 +32,39 @@ You can check [examples](https://github.com/bytebase/terraform-provider-bytebase
31
32
32
33
### Required
33
34
34
-
-`name` (String) The instance unique name.
35
+
-`resource_id` (String) The instance **unique resource id**.
36
+
-`environment` (String) The environment **unique resource id** for the instance.
35
37
36
38
### Read-Only
37
39
38
40
-`id` (Number) The instance id.
41
+
-`title` (String) The instance name.
39
42
-`engine` (String) The instance engine. Should be one of:
40
43
-`MYSQL`
41
44
-`POSTGRES`
42
45
-`TIDB`
43
46
-`SNOWFLAKE`
44
47
-`CLICKHOUSE`
45
-
-`environment` (String) The unique environment name for your instance.
46
-
-`host` (String) Host or socket for your instance, or the account name if the instance type is Snowflake.
47
-
-`port` (String) The port for your instance.
48
+
-`SQLITE`
49
+
-`MONGODB`
48
50
-`external_link` (String) The external console URL managing this instance (e.g. AWS RDS console, your in-house DB instance console)
49
-
-`database` (String) The database for your instance.
50
-
-`data_source_list` (List of Object, Min: 1, Max: 3) The connection for the instance. You can configure read-only or admin connection account here. (see [below for nested schema](#nestedblock--data_source_list))
51
+
-`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))
51
52
52
-
<aid="nestedblock--data_source_list"></a>
53
+
<aid="nestedblock--data_sources"></a>
53
54
54
-
### Nested Schema for `data_source_list`
55
+
### Nested Schema for `data_sources`
55
56
56
57
#### Read-Only
57
58
58
-
-`name` (String) The unique data source name in this instance.
59
+
-`title` (String) The unique data source name in this instance.
59
60
-`type` (String) The data source type. Should be one of:
60
61
-`ADMIN`: The ADMIN type of data source.
61
-
-`RO`: The read-only type of data source.
62
+
-`READ_ONLY`: The read-only type of data source.
62
63
-`username` (String) The connection user name used by Bytebase to perform DDL and DML operations.
63
64
-`password` (String) The connection user password used by Bytebase to perform DDL and DML operations.
64
65
-`ssl_ca` (String) The CA certificate. Optional, you can set this if the engine type is `CLICKHOUSE`.
65
66
-`ssl_cert` (String) The client certificate. Optional, you can set this if the engine type is `CLICKHOUSE`.
66
67
-`ssl_key` (String) The client key. Optional, you can set this if the engine type is `CLICKHOUSE`.
67
-
-`host_override` (String) The Read-replica Host. Only works for RO type data source.
68
-
-`port_override` (String) The Read-replica Port. Only works for RO type data source.
68
+
-`host` (String) Host or socket for the data source, or the account name if the instance type is Snowflake.
69
+
-`port` (String) The port for the data source.
70
+
-`database` (String) The database for the data source.
Copy file name to clipboardExpand all lines: docs/data-sources/instance_list.md
+18-5Lines changed: 18 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,11 +13,20 @@ The instance data source list. You can list instances through `bytebase_instance
13
13
## Example Usage
14
14
15
15
```terraform
16
-
# List instances
16
+
# List all instances in all environments
17
17
data "bytebase_instance_list" "all" {}
18
18
19
19
output "all_instances" {
20
-
value = data.bytebase_instance_list.all.instances
20
+
value = data.bytebase_instance_list.all
21
+
}
22
+
23
+
# List all instances in the "dev" environment
24
+
data "bytebase_instance_list" "dev_instances" {
25
+
environment = "dev"
26
+
}
27
+
28
+
output "dev_instances" {
29
+
value = data.bytebase_instance_list.dev_instances
21
30
}
22
31
```
23
32
@@ -27,9 +36,13 @@ You can check [examples](https://github.com/bytebase/terraform-provider-bytebase
27
36
28
37
## Schema
29
38
39
+
### Optional
40
+
41
+
-`environment` (String) The environment **unique resource id**.
42
+
-`show_deleted` (Boolean) If also show the deleted instances.
43
+
30
44
### Read-Only
31
45
32
-
-`id` (String) The ID of this resource.
33
46
-`instances` (List of Object) (see [below for nested schema](#nestedatt--instances))
34
47
35
48
<aid="nestedatt--instances"></a>
@@ -38,6 +51,6 @@ You can check [examples](https://github.com/bytebase/terraform-provider-bytebase
38
51
39
52
See [Instance Schema](https://registry.terraform.io/providers/bytebase/bytebase/latest/docs/data-sources/instance#schema).
40
53
41
-
### Nested Schema for `data_source_list`
54
+
### Nested Schema for `data_sources`
42
55
43
-
See [Data Source Schema](https://registry.terraform.io/providers/bytebase/bytebase/latest/docs/data-sources/instance#nested-schema-for-data_source_list).
56
+
See [Data Source Schema](https://registry.terraform.io/providers/bytebase/bytebase/latest/docs/data-sources/instance#nested-schema-for-data_sources).
@@ -40,19 +38,15 @@ You can check [examples](https://github.com/bytebase/terraform-provider-bytebase
40
38
41
39
### Required
42
40
43
-
-`name` (String) The environment **unique** name.
41
+
-`resource_id` (String) The environment **unique resource id**. For example, `dev`, `dev-env`.
42
+
-`title` (String) The environment **unique name**. For example, `Dev`.
44
43
-`order` (Number) The environment sorting order. Starting with 1. Lower number appears first in the deployment pipeline.
44
+
45
+
### Optional
46
+
45
47
-`environment_tier_policy` (String) Check [Environment Tier](https://www.bytebase.com/docs/administration/environment-policy/tier) for details. Should be one of:
46
48
-`PROTECTED`
47
49
-`UNPROTECTED`
48
-
-`pipeline_approval_policy` (String) Check [Approval Policy](https://www.bytebase.com/docs/administration/environment-policy/approval-policy) for details. Should be one of:
49
-
-`MANUAL_APPROVAL_NEVER`
50
-
-`MANUAL_APPROVAL_BY_PROJECT_OWNER`
51
-
-`MANUAL_APPROVAL_BY_WORKSPACE_OWNER_OR_DBA`
52
-
-`backup_plan_policy` (String) Check [Backup Schedule Policy](https://www.bytebase.com/docs/administration/environment-policy/backup-schedule-policy) for details. Should be one of:
0 commit comments