Skip to content

Commit

Permalink
chore: override datasource (#74)
Browse files Browse the repository at this point in the history
* chore: update

* chore: update
  • Loading branch information
ecmadao authored Sep 10, 2024
1 parent ddb12e5 commit b318a6a
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ terraform destory

### Generate docs

This will generate the doc template in the `docs` folder
> This will generate the doc template in the `docs` folder
>
> Check https://github.com/hashicorp/terraform-plugin-docs for details.
```bash
go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs --provider-name=terraform-provider-bytebase
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0
1.0.1
20 changes: 20 additions & 0 deletions provider/data_source_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,26 @@ func dataSourceInstance() *schema.Resource {
Computed: true,
Description: "The database for the instance, you can set this if the engine type is POSTGRES.",
},
"password": {
Type: schema.TypeString,
Computed: true,
Description: "The connection user password used by Bytebase to perform DDL and DML operations.",
},
"ssl_ca": {
Type: schema.TypeString,
Computed: true,
Description: "The CA certificate. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB or CLICKHOUSE.",
},
"ssl_cert": {
Type: schema.TypeString,
Computed: true,
Description: "The client certificate. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB or CLICKHOUSE.",
},
"ssl_key": {
Type: schema.TypeString,
Computed: true,
Description: "The client key. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB or CLICKHOUSE.",
},
},
},
},
Expand Down
20 changes: 20 additions & 0 deletions provider/data_source_instance_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,26 @@ func dataSourceInstanceList() *schema.Resource {
Computed: true,
Description: "The database for the instance, you can set this if the engine type is POSTGRES.",
},
"password": {
Type: schema.TypeString,
Computed: true,
Description: "The connection user password used by Bytebase to perform DDL and DML operations.",
},
"ssl_ca": {
Type: schema.TypeString,
Computed: true,
Description: "The CA certificate. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB or CLICKHOUSE.",
},
"ssl_cert": {
Type: schema.TypeString,
Computed: true,
Description: "The client certificate. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB or CLICKHOUSE.",
},
"ssl_key": {
Type: schema.TypeString,
Computed: true,
Description: "The client key. Optional, you can set this if the engine type is MYSQL, POSTGRES, TIDB or CLICKHOUSE.",
},
},
},
},
Expand Down
5 changes: 5 additions & 0 deletions provider/resource_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,11 @@ func flattenDataSourceList(dataSourceList []*api.DataSourceMessage) []interface{
raw["username"] = dataSource.Username
raw["host"] = dataSource.Host
raw["port"] = dataSource.Port
raw["password"] = dataSource.Password
raw["ssl_ca"] = dataSource.SslCa
raw["ssl_cert"] = dataSource.SslCert
raw["ssl_key"] = dataSource.SslKey
raw["database"] = dataSource.Database
res = append(res, raw)
}
return res
Expand Down

0 comments on commit b318a6a

Please sign in to comment.