From 19039787f2bea30e7797da5aa0cd91e14229eb15 Mon Sep 17 00:00:00 2001 From: MrWolong Date: Mon, 13 Jan 2025 16:46:34 +0800 Subject: [PATCH] resource/alicloud_mongodb_instance: Fixed the read error in field replica_sets --- alicloud/resource_alicloud_mongodb_instance.go | 2 +- alicloud/resource_alicloud_mongodb_instance_test.go | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/alicloud/resource_alicloud_mongodb_instance.go b/alicloud/resource_alicloud_mongodb_instance.go index 9feae0b1e3b8..48b8327cedde 100644 --- a/alicloud/resource_alicloud_mongodb_instance.go +++ b/alicloud/resource_alicloud_mongodb_instance.go @@ -299,7 +299,7 @@ func resourceAliCloudMongoDBInstance() *schema.Resource { Computed: true, }, "replica_sets": { - Type: schema.TypeSet, + Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ diff --git a/alicloud/resource_alicloud_mongodb_instance_test.go b/alicloud/resource_alicloud_mongodb_instance_test.go index 6a19d89f78b5..ffa8f32d5a64 100644 --- a/alicloud/resource_alicloud_mongodb_instance_test.go +++ b/alicloud/resource_alicloud_mongodb_instance_test.go @@ -361,8 +361,7 @@ func TestAccAliCloudMongoDBInstance_basic0(t *testing.T) { ResourceName: resourceId, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"account_password", "kms_encrypted_password", "kms_encryption_context", "auto_renew", "ssl_action", "effective_time", "order_type", "parameters", "replica_sets"}, - }, + ImportStateVerifyIgnore: []string{"account_password", "kms_encrypted_password", "kms_encryption_context", "auto_renew", "ssl_action", "effective_time", "order_type", "parameters"}}, }, }) } @@ -693,8 +692,7 @@ func TestAccAliCloudMongoDBInstance_basic1(t *testing.T) { ResourceName: resourceId, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"account_password", "kms_encrypted_password", "kms_encryption_context", "auto_renew", "ssl_action", "effective_time", "order_type", "parameters", "replica_sets"}, - }, + ImportStateVerifyIgnore: []string{"account_password", "kms_encrypted_password", "kms_encryption_context", "auto_renew", "ssl_action", "effective_time", "order_type", "parameters"}}, }, }) } @@ -813,8 +811,7 @@ func TestAccAliCloudMongoDBInstance_basic1_twin(t *testing.T) { ResourceName: resourceId, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"account_password", "kms_encrypted_password", "kms_encryption_context", "auto_renew", "ssl_action", "effective_time", "order_type", "parameters", "replica_sets"}, - }, + ImportStateVerifyIgnore: []string{"account_password", "kms_encrypted_password", "kms_encryption_context", "auto_renew", "ssl_action", "effective_time", "order_type", "parameters"}}, }, }) } @@ -834,6 +831,7 @@ var AliCloudMongoDBInstanceMap0 = map[string]string{ "retention_period": CHECKSET, "replica_set_name": CHECKSET, "ssl_status": CHECKSET, + "replica_sets.#": CHECKSET, } var AliCloudMongoDBInstanceMap1 = map[string]string{ @@ -855,6 +853,7 @@ var AliCloudMongoDBInstanceMap1 = map[string]string{ "retention_period": CHECKSET, "replica_set_name": CHECKSET, "ssl_status": CHECKSET, + "replica_sets.#": CHECKSET, } func AliCloudMongoDBInstanceBasicDependence0(name string) string {