You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tencentcloud/acctest/basic.go
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -818,17 +818,17 @@ locals {
818
818
819
819
// MongoDB
820
820
const (
821
-
DefaultMongoDBVPCId="vpc-rwj54lfr"
822
-
DefaultMongoDBSubnetId="subnet-nyt57zps"
821
+
DefaultMongoDBVPCId="vpc-axrsmmrv"
822
+
DefaultMongoDBSubnetId="subnet-9hcctbue"
823
823
)
824
824
constDefaultMongoDBSecurityGroupId="sg-if748odn"
825
825
constDefaultMongoDBSpec=`
826
826
data "tencentcloud_mongodb_zone_config" "zone_config" {
827
-
available_zone = "ap-guangzhou-6"
827
+
available_zone = "ap-guangzhou-3"
828
828
}
829
829
830
830
data "tencentcloud_security_group" "foo" {
831
-
name = "default"
831
+
name = "keep-mongodb-sg"
832
832
}
833
833
834
834
variable "engine_versions" {
@@ -850,22 +850,22 @@ variable "subnet_id" {
850
850
}
851
851
852
852
locals {
853
-
filtered_spec = [for i in data.tencentcloud_mongodb_zone_config.zone_config.list: i if lookup(i, "machine_type") == "HIO10G" && lookup(i, "engine_version") != "3.2"]
853
+
filtered_spec = [for i in data.tencentcloud_mongodb_zone_config.zone_config.list: i if lookup(i, "machine_type") == "HIO10G" && lookup(i, "engine_version") == "4.4" && lookup(i, "memory") == 4096 && lookup(i, "default_storage") == 256000]
filtered_sharding_spec = [for i in data.tencentcloud_mongodb_zone_config.zone_config.list: i if lookup(i, "cluster_type") == "SHARD" && lookup(i, "min_replicate_set_num") > 0 && lookup(i, "machine_type") == "HIO10G" && lookup(i, "engine_version") != "3.2"]
864
+
filtered_sharding_spec = [for i in data.tencentcloud_mongodb_zone_config.zone_config.list: i if lookup(i, "cluster_type") == "SHARD" && lookup(i, "min_replicate_set_num") > 0 && lookup(i, "machine_type") == "HIO10G" && lookup(i, "engine_version") == "4.4" && lookup(i, "memory") == 4096 && lookup(i, "default_storage") == 256000]
865
865
sharding_spec = concat(local.filtered_sharding_spec, [for i in data.tencentcloud_mongodb_zone_config.zone_config.list: i if lookup(i, "cluster_type") == "SHARD" && lookup(i, "min_replicate_set_num") > 0])
Description: "The number of nodes in each replica set. Default value: 3.",
50
51
},
52
+
"add_node_list": {
53
+
Type: schema.TypeList,
54
+
Optional: true,
55
+
Description: "Add node attribute list.",
56
+
Elem: &schema.Resource{
57
+
Schema: map[string]*schema.Schema{
58
+
"role": {
59
+
Type: schema.TypeString,
60
+
Required: true,
61
+
Description: "The node role that needs to be added.\n"+
62
+
"- SECONDARY: Mongod node;\n"+
63
+
"- READONLY: read-only node;\n"+
64
+
"- MONGOS: Mongos node.",
65
+
},
66
+
"zone": {
67
+
Type: schema.TypeString,
68
+
Required: true,
69
+
Description: "The availability zone corresponding to the node.\n"+
70
+
"- single availability zone, where all nodes are in the same availability zone;\n"+
71
+
"- multiple availability zones: the current standard specification is the distribution of three availability zones, and the master and slave nodes are not in the same availability zone. You should pay attention to configuring the availability zone corresponding to the new node, and the rule that the number of nodes in any two availability zones is greater than the third availability zone must be met after the addition.",
72
+
},
73
+
},
74
+
},
75
+
},
76
+
"remove_node_list": {
77
+
Type: schema.TypeList,
78
+
Optional: true,
79
+
Description: "Add node attribute list.",
80
+
Elem: &schema.Resource{
81
+
Schema: map[string]*schema.Schema{
82
+
"role": {
83
+
Type: schema.TypeString,
84
+
Required: true,
85
+
Description: "The node role that needs to be deleted.\n"+
86
+
"- SECONDARY: Mongod node;\n"+
87
+
"- READONLY: read-only node;\n"+
88
+
"- MONGOS: Mongos node.",
89
+
},
90
+
"node_name": {
91
+
Type: schema.TypeString,
92
+
Required: true,
93
+
Description: "The node ID to delete. The shard cluster must specify the name of the node to be deleted by a group of shards, and the rest of the shards should be grouped and aligned.",
94
+
},
95
+
"zone": {
96
+
Type: schema.TypeString,
97
+
Required: true,
98
+
Description: "The availability zone corresponding to the node.\n"+
99
+
"- single availability zone, where all nodes are in the same availability zone;\n"+
100
+
"- multiple availability zones: the current standard specification is the distribution of three availability zones, and the master and slave nodes are not in the same availability zone. You should pay attention to configuring the availability zone corresponding to the new node, and the rule that the number of nodes in any two availability zones is greater than the third availability zone must be met after the addition.",
101
+
},
102
+
},
103
+
},
104
+
},
51
105
"availability_zone_list": {
52
106
Type: schema.TypeList,
53
107
Optional: true,
@@ -446,36 +500,53 @@ func resourceTencentCloudMongodbInstanceUpdate(d *schema.ResourceData, meta inte
returnresource.RetryableError(fmt.Errorf("[CRITAL] updating mongodb instance, current memory and volume values: %d, %d, waiting for them becoming new value: %d, %d", memoryDes, volumeDes, d.Get("memory").(int), d.Get("volume").(int)))
0 commit comments