hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.5k stars 4.59k forks source link

Support for CosmosDb for Mongodb vcore #24161

Open nickwilliams-codynamic opened 8 months ago

nickwilliams-codynamic commented 8 months ago

Is there an existing issue for this?

Community Note

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/
harshavmb commented 8 months ago

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.

nickwilliams-codynamic commented 8 months ago

@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.

mybayern1974 commented 8 months ago

@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.

lsorber commented 7 months ago

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?

mybayern1974 commented 7 months ago

@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.

em-le-ts commented 7 months ago

+1

philippencal commented 6 months ago

+1

j0eyWh commented 6 months ago

+1

maxe34 commented 6 months ago

+1

jvalteren commented 6 months ago

+1

LozovanuSilviu commented 6 months ago

+1

grisa2467 commented 6 months ago

+1

IrfanSyed-PSC commented 5 months ago

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

ivan-zaitsev commented 4 months ago

Any update on this feature?

igabi commented 2 months ago

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

sinbai commented 2 months ago

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.

luansilvacit commented 2 months ago

Hello, any update on this feature?

budleigh commented 1 month ago

bump for feature.

saulfm08 commented 1 month ago

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

mybayern1974 commented 1 month ago

@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)

KOConchobhair commented 2 weeks ago

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