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

Cannot add a capability and upgrade the CosmosDB version at the same time. #23986

Closed
1 task done
moialbla opened this issue Nov 22, 2023 · 3 comments · Fixed by #24029
Closed
1 task done

Cannot add a capability and upgrade the CosmosDB version at the same time. #23986

moialbla opened this issue Nov 22, 2023 · 3 comments · Fixed by #24029

Comments

@moialbla
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

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 and review the contribution guide to help.

Terraform Version

1.6.4

AzureRM Provider Version

3.81.0

Affected Resource(s)/Data Source(s)

azurerm_cosmosdb_account

Terraform Configuration Files

provider "azurerm" {
  features = {}
}

resource "azurerm_resource_group" "cosmosdb_rg" {
  name     = "cosmosdb-rg"
  location = "East US"  # Change this to your desired region
}

resource "azurerm_cosmosdb_account" "cosmosdb" {
  name                = "cosmosdb-account"
  location            = azurerm_resource_group.cosmosdb_rg.location
  resource_group_name = azurerm_resource_group.cosmosdb_rg.name
  offer_type          = "Standard"
  kind                = "MongoDB"
  mongo_server_version            = 4.2 # this value was 3.6

  consistency_policy {
    consistency_level       = "Session"
    max_interval_in_seconds = 5
    max_staleness_prefix   = 100
  }

  enable_multiple_write_locations = false

  geo_location {
    location          = azurerm_resource_group.cosmosdb_rg.location
    failover_priority = 0
    is_zone_redundant = false
  }

  capabilities {
    name = "EnableMongo"
  }

  capabilities {
    name = "EnableMongo16MBDocumentSupport"
  }
}

Debug Output/Panic Output

documentdb.DatabaseAccountsClient#Update: Failure sending request: StatusCode=400 -- Original Error: Code="BadRequest" Message="\"EnableMongo16MBDocumentSupport capability is not compatible with mongo ServerVersion=3.6 accounts.\"\r\nActivityId: 00000, Microsoft.Azure.Documents.Common/2.14.0"

Expected Behaviour

2023-11-22T09:54:30.7581303Z ~ resource "azurerm_cosmosdb_account" "cosmos_db" {
2023-11-22T09:54:30.7582734Z id = "/subscriptions/0000000000000/resourceGroups/MY-RG/providers/Microsoft.DocumentDB/databaseAccounts/cosmosdb-account"
2023-11-22T09:54:30.7584118Z ~ mongo_server_version = "3.6" -> "4.2"
2023-11-22T09:54:30.7584812Z name = "cosmosdb-account"
2023-11-22T09:54:30.7588038Z
2023-11-22T09:54:30.7588290Z + capabilities {
2023-11-22T09:54:30.7588656Z + name = "EnableMongo16MBDocumentSupport"
2023-11-22T09:54:30.7589106Z }
2023-11-22T09:54:30.7589268Z
2023-11-22T09:54:30.7589538Z # (6 unchanged blocks hidden)
2023-11-22T09:54:30.7589920Z }****

Actual Behaviour

No response

Steps to Reproduce

1 - Create a Cosmosdb -Mongo DB version 3.6
2 - Update the Cosmosdb.tf version from 3.6 to 4.2 and add the new capability EnableMongo16MBDocumentSupport
3 - Run the Terraform

Important Factoids

No response

References

No response

@sinbai
Copy link
Contributor

sinbai commented Nov 27, 2023

Hi @moialbla thanks for opening this issue. PR has been submitted to fix this issue. Could you please track it for more updates?

@rcskosir rcskosir added the bug label Nov 27, 2023
@github-actions github-actions bot added this to the v3.83.0 milestone Nov 28, 2023
@moialbla
Copy link
Author

Sure thing!
Thanks!

Copy link

github-actions bot commented May 1, 2024

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 May 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants