diff --git a/README.md b/README.md index ebb1226..a10bea3 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/VERSION b/VERSION index afaf360..7f20734 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.0 \ No newline at end of file +1.0.1 \ No newline at end of file diff --git a/provider/data_source_instance.go b/provider/data_source_instance.go index 35f05b6..739c9b2 100644 --- a/provider/data_source_instance.go +++ b/provider/data_source_instance.go @@ -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.", + }, }, }, }, diff --git a/provider/data_source_instance_list.go b/provider/data_source_instance_list.go index c4fffc4..70692fa 100644 --- a/provider/data_source_instance_list.go +++ b/provider/data_source_instance_list.go @@ -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.", + }, }, }, }, diff --git a/provider/resource_instance.go b/provider/resource_instance.go index 8292cfe..204ec95 100644 --- a/provider/resource_instance.go +++ b/provider/resource_instance.go @@ -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