Skip to content

Commit 2d22cc4

Browse files
authored
chore: remove id for data source (#23)
1 parent 698ae81 commit 2d22cc4

File tree

7 files changed

+37
-22
lines changed

7 files changed

+37
-22
lines changed

.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
11
vendor
22
examples/.terraform*
33
examples/terraform.*
4+
5+
# Local .terraform directories
6+
**/.terraform/*
7+
**/.terraform.lock.hcl
8+
9+
# .tfstate files
10+
*.tfstate
11+
*.tfstate.*
12+
13+
# Crash log files
14+
crash.log
15+
crash.*.log
16+
17+
# Exclude all .tfvars files, which are likely to contain sensitive data, such as
18+
# password, private keys, and other secrets. These should not be part of version
19+
# control as they are data points which are potentially sensitive and subject
20+
# to change depending on the environment.
21+
*.tfvars
22+
*.tfvars.json
23+
24+
# Ignore override files as they are usually used to override resources locally and so
25+
# are not checked in
26+
override.tf
27+
override.tf.json
28+
*_override.tf
29+
*_override.tf.json
30+
31+
# Include override files you do wish to add to version control using negated pattern
32+
# !example_override.tf
33+
34+
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
35+
# example: *tfplan*
36+
37+
# Ignore CLI configuration files
38+
.terraformrc
39+
terraform.rc

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.5-alpha
1+
0.0.5-beta

docs/data-sources/instance.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ You can check [examples](https://github.com/bytebase/terraform-provider-bytebase
5555

5656
#### Read-Only
5757

58-
- `id` (Number) The data source id.
5958
- `name` (String) The unique data source name in this instance.
6059
- `type` (String) The data source type. Should be one of:
6160
- `ADMIN`: The ADMIN type of data source.

docs/resources/instance.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,3 @@ You can check [examples](https://github.com/bytebase/terraform-provider-bytebase
8080
- `ssl_key` (String) The client key. Optional, you can set this if the engine type is `CLICKHOUSE`.
8181
- `host_override` (String) The Read-replica Host. Only works for RO type data source.
8282
- `port_override` (String) The Read-replica Port. Only works for RO type data source.
83-
84-
#### Read-Only
85-
86-
- `id` (String) The data source unique id.

provider/data_source_instance.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,6 @@ func dataSourceInstance() *schema.Resource {
6868
Computed: true,
6969
Elem: &schema.Resource{
7070
Schema: map[string]*schema.Schema{
71-
"id": {
72-
Type: schema.TypeInt,
73-
Computed: true,
74-
Description: "The data source unique id",
75-
},
7671
"name": {
7772
Type: schema.TypeString,
7873
Computed: true,

provider/data_source_instance_list.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,6 @@ func dataSourceInstanceList() *schema.Resource {
7171
Computed: true,
7272
Elem: &schema.Resource{
7373
Schema: map[string]*schema.Schema{
74-
"id": {
75-
Type: schema.TypeInt,
76-
Computed: true,
77-
Description: "The data source unique id",
78-
},
7974
"name": {
8075
Type: schema.TypeString,
8176
Computed: true,

provider/resource_instance.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,6 @@ func resourceInstance() *schema.Resource {
8484
Description: "The connection for the instance. You can configure read-only or admin connection account here.",
8585
Elem: &schema.Resource{
8686
Schema: map[string]*schema.Schema{
87-
"id": {
88-
Type: schema.TypeInt,
89-
Computed: true,
90-
Description: "The data source unique id.",
91-
},
9287
"name": {
9388
Type: schema.TypeString,
9489
Required: true,
@@ -304,7 +299,6 @@ func flattenDataSourceList(dataSourceList []*api.DataSource) []interface{} {
304299
res := []interface{}{}
305300
for _, dataSource := range dataSourceList {
306301
raw := map[string]interface{}{}
307-
raw["id"] = dataSource.ID
308302
raw["name"] = dataSource.Name
309303
raw["type"] = dataSource.Type
310304
raw["username"] = dataSource.Username

0 commit comments

Comments
 (0)