Skip to content

Commit b318a6a

Browse files
authored
chore: override datasource (#74)
* chore: update * chore: update
1 parent ddb12e5 commit b318a6a

File tree

5 files changed

+49
-2
lines changed

5 files changed

+49
-2
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ terraform destory
7171

7272
### Generate docs
7373

74-
This will generate the doc template in the `docs` folder
74+
> This will generate the doc template in the `docs` folder
75+
>
76+
> Check https://github.com/hashicorp/terraform-plugin-docs for details.
7577
7678
```bash
7779
go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs --provider-name=terraform-provider-bytebase

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.0
1+
1.0.1

provider/data_source_instance.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,26 @@ func dataSourceInstance() *schema.Resource {
8282
Computed: true,
8383
Description: "The database for the instance, you can set this if the engine type is POSTGRES.",
8484
},
85+
"password": {
86+
Type: schema.TypeString,
87+
Computed: true,
88+
Description: "The connection user password used by Bytebase to perform DDL and DML operations.",
89+
},
90+
"ssl_ca": {
91+
Type: schema.TypeString,
92+
Computed: true,
93+
Description: "The CA certificate. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB or CLICKHOUSE.",
94+
},
95+
"ssl_cert": {
96+
Type: schema.TypeString,
97+
Computed: true,
98+
Description: "The client certificate. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB or CLICKHOUSE.",
99+
},
100+
"ssl_key": {
101+
Type: schema.TypeString,
102+
Computed: true,
103+
Description: "The client key. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB or CLICKHOUSE.",
104+
},
85105
},
86106
},
87107
},

provider/data_source_instance_list.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,26 @@ func dataSourceInstanceList() *schema.Resource {
9393
Computed: true,
9494
Description: "The database for the instance, you can set this if the engine type is POSTGRES.",
9595
},
96+
"password": {
97+
Type: schema.TypeString,
98+
Computed: true,
99+
Description: "The connection user password used by Bytebase to perform DDL and DML operations.",
100+
},
101+
"ssl_ca": {
102+
Type: schema.TypeString,
103+
Computed: true,
104+
Description: "The CA certificate. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB or CLICKHOUSE.",
105+
},
106+
"ssl_cert": {
107+
Type: schema.TypeString,
108+
Computed: true,
109+
Description: "The client certificate. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB or CLICKHOUSE.",
110+
},
111+
"ssl_key": {
112+
Type: schema.TypeString,
113+
Computed: true,
114+
Description: "The client key. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB or CLICKHOUSE.",
115+
},
96116
},
97117
},
98118
},

provider/resource_instance.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,11 @@ func flattenDataSourceList(dataSourceList []*api.DataSourceMessage) []interface{
390390
raw["username"] = dataSource.Username
391391
raw["host"] = dataSource.Host
392392
raw["port"] = dataSource.Port
393+
raw["password"] = dataSource.Password
394+
raw["ssl_ca"] = dataSource.SslCa
395+
raw["ssl_cert"] = dataSource.SslCert
396+
raw["ssl_key"] = dataSource.SslKey
397+
raw["database"] = dataSource.Database
393398
res = append(res, raw)
394399
}
395400
return res

0 commit comments

Comments
 (0)