Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_cosmosdb_account forcing EnableMongo on DocumentDB #14116

Closed
prateekmanasvi01 opened this issue Nov 10, 2021 · 2 comments · Fixed by #14924
Closed

azurerm_cosmosdb_account forcing EnableMongo on DocumentDB #14116

prateekmanasvi01 opened this issue Nov 10, 2021 · 2 comments · Fixed by #14924

Comments

@prateekmanasvi01
Copy link

prateekmanasvi01 commented Nov 10, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Terraform v1.0.6
on windows_amd64

  • provider registry.terraform.io/hashicorp/azurerm v2.83.0

Affected Resource(s)

azurerm_cosmosdb_account

Terraform Configuration Files

resource "azurerm_cosmosdb_account" "dba-fca" {
name = "cosmosdba-test-dg-tbd"
location = "westeurope"
resource_group_name = "rg-fca-we-dev"
offer_type = "Standard"
kind = "GlobalDocumentDB"
enable_free_tier = false
enable_multiple_write_locations = false
is_virtual_network_filter_enabled = true
analytical_storage_enabled = false
consistency_policy {
consistency_level = "Session"
}

capabilities {
name = "EnableAggregationPipeline"
}

capabilities {
name = "mongoEnableDocLevelTTL"
}

capabilities {
name = "MongoDBv3.4"
}

/*capabilities {
name = "EnableMongo"
} */

geo_location {
location = "westeurope"
failover_priority = 0
}

}

Debug Output

azurerm_cosmosdb_account.dba-fca: Refreshing state... [id=/subscriptions/*****/resou╷
│ Error: capability EnableMongo must be enabled if MongoDBv3.4 is also enabled

│ with azurerm_cosmosdb_account.dba-fca,
│ on main.tf line 35, in resource "azurerm_cosmosdb_account" "dba-fca":
│ 35: resource "azurerm_cosmosdb_account" "dba-fca" {

Panic Output

Expected Behaviour

This was running fine but suddenly started giving this issue.

Actual Behaviour

Steps to Reproduce

  1. terraform apply

Important Factoids

If I add the capability EnableMongo on terraform it says it will destroy cosmoDB account which we cant.
If I try to update capability via azure cli we get below

az cosmosdb update --capabilities EnableMongo --name cosmosdba-test-dg-tbd --resource-group rg-fca-we-dev
BadRequestError: Operation failed with status: 'BadRequest'. Details: "EnableMongo capability is not allowed with kind=GlobalDocumentDB"

References

  • #0000
@xiaxyi
Copy link
Contributor

xiaxyi commented Nov 16, 2021

@prateekmanasvi01, the property value enableMongo can't be set for the SQL API(kind: GlobalDocumentDB). The API is defined during the creation and cannot be modified afterwards.

As for the capability MongoDBv3.4, Azure also set enableMongo if it's enabled. Considering the property is forceNew, to prevent the database from being destroyed, we need to throw an error, you can refer to the PR#13757
hope it helps!

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants