From 22f21085c247ef8c9b663b424e5d459ed0b03cd6 Mon Sep 17 00:00:00 2001 From: elena Date: Mon, 25 Oct 2021 16:19:55 +0800 Subject: [PATCH] 1.Ignore the change of capabilities. 2.Add test case to cover the case that the capabilities is not set when the value of kind property is set to MongoDB. 3.doc-fix: supplement missing info about capabilities attribute. --- internal/services/cosmos/cosmosdb_account_resource.go | 1 + internal/services/cosmos/cosmosdb_account_resource_test.go | 4 ++++ website/docs/r/cosmosdb_account.html.markdown | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/services/cosmos/cosmosdb_account_resource.go b/internal/services/cosmos/cosmosdb_account_resource.go index 98674ac11d26..47351630c7aa 100644 --- a/internal/services/cosmos/cosmosdb_account_resource.go +++ b/internal/services/cosmos/cosmosdb_account_resource.go @@ -237,6 +237,7 @@ func resourceCosmosDbAccount() *pluginsdk.Resource { "capabilities": { Type: pluginsdk.TypeSet, Optional: true, + Computed: true, ForceNew: true, Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ diff --git a/internal/services/cosmos/cosmosdb_account_resource_test.go b/internal/services/cosmos/cosmosdb_account_resource_test.go index 5d9849e39510..167c850a7bbe 100644 --- a/internal/services/cosmos/cosmosdb_account_resource_test.go +++ b/internal/services/cosmos/cosmosdb_account_resource_test.go @@ -60,6 +60,10 @@ func TestAccCosmosDBAccount_basic_mongo_strong(t *testing.T) { testAccCosmosDBAccount_basicMongoDBWith(t, documentdb.DefaultConsistencyLevelStrong) } +func TestAccCosmosDBAccount_basic_mongo_strong_without_capability(t *testing.T) { + testAccCosmosDBAccount_basicWith(t, documentdb.DatabaseAccountKindMongoDB, documentdb.DefaultConsistencyLevelStrong) +} + func TestAccCosmosDBAccount_basic_parse_boundedStaleness(t *testing.T) { testAccCosmosDBAccount_basicWith(t, documentdb.DatabaseAccountKindParse, documentdb.DefaultConsistencyLevelBoundedStaleness) } diff --git a/website/docs/r/cosmosdb_account.html.markdown b/website/docs/r/cosmosdb_account.html.markdown index c0f409f0a615..6b629addddca 100644 --- a/website/docs/r/cosmosdb_account.html.markdown +++ b/website/docs/r/cosmosdb_account.html.markdown @@ -96,7 +96,7 @@ The following arguments are supported: * `public_network_access_enabled` - (Optional) Whether or not public network access is allowed for this CosmosDB account. -* `capabilities` - (Optional) The capabilities which should be enabled for this Cosmos DB account. Value is a `capabilities` block as defined below. +* `capabilities` - (Optional) The capabilities which should be enabled for this Cosmos DB account. Value is a `capabilities` block as defined below. Changing this forces a new resource to be created. * `is_virtual_network_filter_enabled` - (Optional) Enables virtual network filtering for this Cosmos DB account.