terraform-provider-azurerm icon indicating copy to clipboard operation
terraform-provider-azurerm copied to clipboard

Support for CosmosDb for Mongodb vcore

Open nickwilliams-codynamic opened this issue 1 year ago • 18 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Community Note

  • Please vote on this issue by adding a :thumbsup: 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.

Description

Add support for CosmosDb for MongoDb v5 (vcore) model.

https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/vcore/

Given the differences between the RU and vcore setup I'm not sure if this would be an extension to the existing resource, or a new resource entirely.

New or Affected Resource(s)/Data Source(s)

azurerm_cosmosdb_account

Potential Terraform Configuration

resource "azurerm_resource_group" "example" {
  name     = "example-resource-group"
  location = "West Europe"
}

resource "random_integer" "ri" {
  min = 10000
  max = 99999
}

resource "azurerm_cosmosdb_account" "db" {
  name                = "tfex-cosmos-db-${random_integer.ri.result}"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  offer_type          = "Standard"
  kind                = "MongoDB"

  enable_automatic_failover = true

  capabilities {
    name = "EnableAggregationPipeline"
  }

  capabilities {
    name = "mongoEnableDocLevelTTL"
  }

  capabilities {
    name = "MongoDBv5"
  }

  capabilities {
    name = "EnableMongo"
  }

  node_group_specs = [
        {
            kind: 'Shard'
            node_count: 1
            sku: 'M40'
            disk_size_gb: 128
            enable_ha: false
        }
    ]

  
}


### References

https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/vcore/

nickwilliams-codynamic avatar Dec 08 '23 08:12 nickwilliams-codynamic

The closest I could relate is cosmosdb_cassandra_datacenter using Microsoft.DocumentDB/cassandraClusters API. Similarly Mongo cluster resource could have cosmosdb_mongo_datacenter name using Microsoft.DocumentDB/mongoClusters API. Lot of attributes are similar.

harshavmb avatar Dec 19 '23 14:12 harshavmb

@mybayern1974 what is the 'preview' label? Does that related to Azure resources being in Preview? If so, CosmosDb for MongoDb vcore is GA now - announced at ignite.

nickwilliams-codynamic avatar Dec 20 '23 10:12 nickwilliams-codynamic

@nickwilliams-codynamic The reason I marked this as preview is, per what I've noticed, this feature only appears in the Azure service preview API version. To ensure it's technically safe to have Terraform AzureRM support this feature, I may suggest either wait for this feature appear in the Azure service stable API version or the Azure service team could confirm that preview API version could be regarded as same bar of stable APIs. I can help offline confirm with Azure teams on the latter and update here accordingly.

As for explanation on why I mentioned "technically safe" above, please refer to this comment I commented in another issue.

mybayern1974 avatar Dec 20 '23 12:12 mybayern1974

To ensure it's technically safe to have Terraform AzureRM support this feature, I may suggest either wait for this feature appear in the Azure service stable API version or the Azure service team could confirm that preview API version could be regarded as same bar of stable APIs. I can help offline confirm with Azure teams on the latter and update here accordingly.

Any news on this @mybayern1974?

lsorber avatar Jan 19 '24 12:01 lsorber

@lsorber and all, we just got updates from the Azure Cosmos DB service team that this feature is still needed to be hosted in preview API and there is possibility there would be breaking changes related with this feature. When this feature could be stable is still under evaluation. The service team honors users' expectation to this feature in this provider, so evaluating the timeline of this feature being in stable API is one of their priorities though there is not a timeline explicitly shared now. With all above, my previous comment still applies. Furthermore, I've shared this GH issue with the service team so let's see whether contacts from the service team could share more details here if there are.

mybayern1974 avatar Jan 23 '24 03:01 mybayern1974

+1

em-le-ts avatar Jan 30 '24 09:01 em-le-ts

+1

philippencal avatar Feb 13 '24 09:02 philippencal

+1

j0eyWh avatar Feb 19 '24 09:02 j0eyWh

+1

maxe34 avatar Feb 28 '24 09:02 maxe34

+1

jvalteren avatar Feb 28 '24 09:02 jvalteren

+1

LozovanuSilviu avatar Feb 28 '24 09:02 LozovanuSilviu

+1

grisa2467 avatar Feb 28 '24 09:02 grisa2467

Any update on this feature ? vCore is not preview anymore in Cosmos.

IrfanSyed-PSC avatar Mar 26 '24 15:03 IrfanSyed-PSC

Any update on this feature?

ivan-zaitsev avatar Apr 16 '24 14:04 ivan-zaitsev

This MR has been merged and "Azure Cosmos DB for MongoDB vCore" is no longer listed in the latest preview . mybayern1974

igabi avatar Jun 04 '24 10:06 igabi

Hi @igabi, thanks for the updates. The mongoCluster.json has indeed been removed from the latest preview, however, I assume that the mongoCluster.json was just moved to another folder, which is still in preview. Also, I did not find mongoCluster.json available in any stable API version. Please feel free let us know if you find it in a stable API version, thanks.

sinbai avatar Jun 05 '24 03:06 sinbai

Hello, any update on this feature?

luansilvacit avatar Jun 18 '24 16:06 luansilvacit

bump for feature.

budleigh avatar Jul 01 '24 11:07 budleigh

This makes me very upset. vcore not enabled and the RU latest supported is v6

saulfm08 avatar Jul 03 '24 22:07 saulfm08

@saulfm08 , as well as to all here who expect this feature, with understanding your expectation, I however suggest or to say share transparency that the feature expectation is not at Terraform right now, instead, at the upstream service (API). Per commented above as here and here in this thread, this feature is not presented in a stable API version (per our latest observation, or anyone please correct me if you observe this feature appear in any stable service API version) but only a preview version, and there is a risk for Terraform to support preview features (reason has also been provided here). Furthermore, worth to mention, in one of my previous ticket filed to the target service team, they indicated it's possible the current preview API hosting this expected feature may introduce breaking change from their next stable API versions, if that happened, users who would have felt comfortable to get this feature in TF consuming the preview API version is possible to run into trouble when TF would have found TF cannot smoothly consume the next stable API version, which could include more wanted features by users, for that new API would be not backward compatible.

With above, I would suggest people who expect this feature in TF to file a ticket to target service team to consult their stable API release timeline (indeed, I did that recently with getting a response that it would come out soon though no concrete ETA provided)

mybayern1974 avatar Jul 04 '24 01:07 mybayern1974

I just came across this in case it helps anyone. However, I suppose it is still subject to the potential breaking API changes issue being discussed above.

Full support for Terraform is targetted for the second half of 2024.

https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/vcore/quickstart-terraform

KOConchobhair avatar Aug 12 '24 16:08 KOConchobhair