From 9dc34aadd0869acd7dd3266a57f3cd012adad315 Mon Sep 17 00:00:00 2001 From: BenBeng Date: Thu, 25 Apr 2024 16:28:58 +0800 Subject: [PATCH] v1.20.6 --- CHANGELOG.md | 4 ++-- baiducloud/connectivity/client.go | 2 +- baiducloud/provider.go | 15 +++++++++++++++ .../service/mongodb/data_source_instances.go | 2 +- website/docs/d/mongodb_instances.html.markdown | 2 +- 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50a1633d..9047d4da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ - ## 1.20.6 (Unreleased) -## 1.20.5 (April 25, 2024) + ## 1.20.7 (Unreleased) +## 1.20.6 (April 25, 2024) FEATURES: - **New Resource:** `baiducloud_mongodb_instance` - **New Resource:** `baiducloud_mongodb_sharding_instance` diff --git a/baiducloud/connectivity/client.go b/baiducloud/connectivity/client.go index e4d923cb..467be718 100644 --- a/baiducloud/connectivity/client.go +++ b/baiducloud/connectivity/client.go @@ -83,7 +83,7 @@ type ApiVersion string var goSdkMutex = sync.RWMutex{} // The Go SDK is not thread-safe -var providerVersion = "1.20.5" +var providerVersion = "1.20.6" // Client for BaiduCloudClient func (c *Config) Client() (*BaiduClient, error) { diff --git a/baiducloud/provider.go b/baiducloud/provider.go index cbfb1542..dc1a1081 100644 --- a/baiducloud/provider.go +++ b/baiducloud/provider.go @@ -126,6 +126,7 @@ import ( "github.com/terraform-providers/terraform-provider-baiducloud/baiducloud/service/bec" "github.com/terraform-providers/terraform-provider-baiducloud/baiducloud/service/cdn" "github.com/terraform-providers/terraform-provider-baiducloud/baiducloud/service/iam" + "github.com/terraform-providers/terraform-provider-baiducloud/baiducloud/service/mongodb" "github.com/terraform-providers/terraform-provider-baiducloud/baiducloud/service/snic" "os" "strings" @@ -244,6 +245,7 @@ func Provider() terraform.ResourceProvider { "baiducloud_iam_access_keys": iam.DataSourceAccessKeys(), "baiducloud_et_gateways": dataSourceBaiduCloudEtGateways(), "baiducloud_et_gateway_associations": dataSourceBaiduCloudEtGatewayAssociations(), + "baiducloud_mongodb_instances": mongodb.DataSourceInstances(), }, ResourcesMap: map[string]*schema.Resource{ @@ -326,6 +328,8 @@ func Provider() terraform.ResourceProvider { "baiducloud_iam_access_key": iam.ResourceAccessKey(), "baiducloud_et_gateway": resourceBaiduCloudEtGateway(), "baiducloud_et_gateway_association": resourceBaiduCloudEtGatewayAssociation(), + "baiducloud_mongodb_instance": mongodb.ResourceInstance(), + "baiducloud_mongodb_sharding_instance": mongodb.ResourceShardingInstance(), }, ConfigureFunc: providerConfigure, @@ -381,6 +385,9 @@ func init() { "vpn_endpoint": "Use this to override the default endpoint URL constructed from the `region`. It's typically used to connect to custom VPN endpoints.", "dns_endpoint": "Use this to override the default endpoint URL constructed from the `region`. It's typically used to connect to custom DNS endpoints.", + + "mongodb_endpoint": "Use this to override the default endpoint URL constructed from the `region`. " + + "It's typically used to connect to custom MONGODB endpoints.", } } @@ -486,6 +493,12 @@ func endpointsSchema() *schema.Schema { Default: "", Description: descriptions["dns_endpoint"], }, + "mongodb": { + Type: schema.TypeString, + Optional: true, + Default: "", + Description: descriptions["mongodb_endpoint"], + }, }, }, Set: endpointsToHash, @@ -511,6 +524,7 @@ func endpointsToHash(v interface{}) int { buf.WriteString(fmt.Sprintf("%s-", m["bbc"].(string))) buf.WriteString(fmt.Sprintf("%s-", m["vpn"].(string))) buf.WriteString(fmt.Sprintf("%s-", m["dns"].(string))) + buf.WriteString(fmt.Sprintf("%s-", m["mongodb"].(string))) return hashcode.String(buf.String()) } @@ -578,6 +592,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) { config.ConfigEndpoints[connectivity.BBCCode] = strings.TrimSpace(endpoints["bbc"].(string)) config.ConfigEndpoints[connectivity.VPNCode] = strings.TrimSpace(endpoints["vpn"].(string)) config.ConfigEndpoints[connectivity.DNSCode] = strings.TrimSpace(endpoints["dns"].(string)) + config.ConfigEndpoints[connectivity.MONGODBCode] = strings.TrimSpace(endpoints["mongodb"].(string)) } client, err := config.Client() diff --git a/baiducloud/service/mongodb/data_source_instances.go b/baiducloud/service/mongodb/data_source_instances.go index 35816633..95ea7737 100644 --- a/baiducloud/service/mongodb/data_source_instances.go +++ b/baiducloud/service/mongodb/data_source_instances.go @@ -58,7 +58,7 @@ func schemaInstance() *schema.Resource { }, "name": { Type: schema.TypeString, - Description: "Name of the instance. If not specified, it will be randomly generated.", + Description: "Name of the instance.", Computed: true, }, "payment_timing": flex.ComputedSchemaPaymentTiming(), diff --git a/website/docs/d/mongodb_instances.html.markdown b/website/docs/d/mongodb_instances.html.markdown index 01b7b43c..69f40a09 100644 --- a/website/docs/d/mongodb_instances.html.markdown +++ b/website/docs/d/mongodb_instances.html.markdown @@ -48,7 +48,7 @@ Read-Only: - `instance_id` (String) ID of the instance. - `memory_capacity` (Number) Memory size (GB) of the instance. - `mongos_count` (Number) Number of mongos nodes in the sharding instance. -- `name` (String) Name of the instance. If not specified, it will be randomly generated. +- `name` (String) Name of the instance. - `payment_timing` (String) Payment timing of billing. Possible values: `Prepaid`, `Postpaid`. - `port` (String) Connection port of the instance. - `readonly_node_num` (Number) Number of readonly nodes in the instance. Possible values: `0`~`5`.