From 9d1f4cd93daad6dcc3b081021b2cebb37ecf5efa Mon Sep 17 00:00:00 2001 From: Elena Xin <39109137+sinbai@users.noreply.github.com> Date: Fri, 29 Oct 2021 02:50:14 +0800 Subject: [PATCH] azurerm_cosmosdb_account: Ignore the change of capabilities property (#13936) --- 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.