Skip to content

Commit

Permalink
v1.20.6
Browse files Browse the repository at this point in the history
  • Loading branch information
BenBeng committed Apr 25, 2024
1 parent 452934e commit 9dc34aa
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`
Expand Down
2 changes: 1 addition & 1 deletion baiducloud/connectivity/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
15 changes: 15 additions & 0 deletions baiducloud/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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.",
}
}

Expand Down Expand Up @@ -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,
Expand All @@ -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())
}

Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion baiducloud/service/mongodb/data_source_instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion website/docs/d/mongodb_instances.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down

0 comments on commit 9dc34aa

Please sign in to comment.