Skip to content

Commit

Permalink
Merge pull request #72 from volcengine/bugfix/fix_mongodb_import
Browse files Browse the repository at this point in the history
Bugfix/fix mongodb import
  • Loading branch information
xuyaming0800 authored Mar 21, 2023
2 parents 3489a5b + 91cfa5c commit e0851b7
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 35 deletions.
2 changes: 1 addition & 1 deletion common/common_volcengine_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package common

const (
TerraformProviderName = "terraform-provider-volcengine"
TerraformProviderVersion = "0.0.61"
TerraformProviderVersion = "0.0.62"
)
22 changes: 14 additions & 8 deletions example/mongoDBInstance/main.tf
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
resource "volcengine_mongodb_instance" "foo"{
zone_id="cn-xxx"
instance_type="ShardedCluster"
node_spec="mongo.xxx"
mongos_node_spec="mongo.mongos.xxx"
shard_number=3
storage_space_gb=100
subnet_id="subnet-2d6pxxu"
instance_name="tf-test"
zone_id="cn-beijing-a"
instance_type="ReplicaSet"
node_spec="mongo.2c4g"
# mongos_node_spec="mongo.2c4g"
# shard_number=3
storage_space_gb=20
subnet_id="subnet-rrx4ns6abw1sv0x57wq6h47"
instance_name="mongo-replica-be9995d32e4a"
charge_type="PostPaid"
super_account_password = "******"
# period_unit="Month"
# period=1
# auto_renew=false
# ssl_action="Close"
# lifecycle {
# ignore_changes = [
# super_account_password,
# ]
# }
}
15 changes: 0 additions & 15 deletions example/mongodb/import/main.tf

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@ func (s *VolcengineMongoDBInstanceService) ReadResource(resourceData *schema.Res
nodes := temp.([]interface{})
data["NodeNumber"] = len(nodes)
data["NodeSpec"] = nodes[0].(map[string]interface{})["NodeSpec"]
data["StorageSpaceGb"] = nodes[0].(map[string]interface{})["TotalStorageGB"]
} else {
data["NodeNumber"] = 0
}
}
if data["InstanceType"].(string) == "ShardedCluster" {
} else if data["InstanceType"].(string) == "ShardedCluster" {
if temp, ok := data["Mongos"]; ok && temp != nil {
mongos := temp.([]interface{})
data["MongosNodeNumber"] = len(mongos)
Expand Down
24 changes: 15 additions & 9 deletions website/docs/r/mongodb_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,25 @@ Provides a resource to manage mongodb instance
## Example Usage
```hcl
resource "volcengine_mongodb_instance" "foo" {
zone_id = "cn-xxx"
instance_type = "ShardedCluster"
node_spec = "mongo.xxx"
mongos_node_spec = "mongo.mongos.xxx"
shard_number = 3
storage_space_gb = 100
subnet_id = "subnet-2d6pxxu"
instance_name = "tf-test"
charge_type = "PostPaid"
zone_id = "cn-beijing-a"
instance_type = "ReplicaSet"
node_spec = "mongo.2c4g"
# mongos_node_spec="mongo.2c4g"
# shard_number=3
storage_space_gb = 20
subnet_id = "subnet-rrx4ns6abw1sv0x57wq6h47"
instance_name = "mongo-replica-be9995d32e4a"
charge_type = "PostPaid"
super_account_password = "******"
# period_unit="Month"
# period=1
# auto_renew=false
# ssl_action="Close"
# lifecycle {
# ignore_changes = [
# super_account_password,
# ]
# }
}
```
## Argument Reference
Expand Down

0 comments on commit e0851b7

Please sign in to comment.