CosmosDB suports setting throughput at a database level and shared across collections, this is not currently possible when provisioning using terraform.
This affects the cost and performance so is needed for this resource
resource "azurerm_cosmosdb_sql_database" "example" {
name = "tfex-cosmos-mongo-db"
resource_group_name = "${data.azurerm_cosmosdb_account.example.resource_group_name}"
account_name = "${data.azurerm_cosmosdb_account.example.name}"
throughput = 400
}
The options are set using a map of strings https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/azurerm/resource_arm_cosmosdb_sql_database.go (see line 75)
I can only encourage this feature: we recently migrated from a MongoDB in Heroku to a CosmosDB in Azure, and now realise that each collection within the terraformed CosmosDB is a separate cost item. Collections in MongoDB are not the same in CosmosDB, the former uses them for storing docs of a same type, while the latter is able to store docs of different types.
I also just started using the cosmosdb_mongo_collection resource and was disappointed I couldn't set the throughput for a mongodb collection.
https://www.terraform.io/docs/providers/azurerm/r/cosmosdb_mongo_collection.html
@jpovey apologies for being dense (first time using terraform in a while), but I tried this, which didn't work:
resource "azurerm_cosmosdb_mongo_collection" "collection" {
name = "my_collection"
.
.
.
{ throughput = 1000 }
Must be something I'm missing?
Actually, my issue looks to be related to https://github.com/terraform-providers/terraform-provider-azurerm/issues/3586
@christonog, looks like this is a duplicate of #3586 so i am going to close this. If you think this is an error please feel free to reopen it!
Actually upon a closer look that is mongo, and this is SQL, reopening. apologies!
guys, any update on this issue. I'm facing this issue my terraform proj as well.
The options are set using a map of strings https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/azurerm/resource_arm_cosmosdb_sql_database.go (see line 75)
please explain with a sample. I've tried {througtput = 400}. it's not working.
For those getting confused by @jpovey's comment – My impression is: it's being pointed out that this looks possible using the Go SDK (though I'm not sure how you pass in that map of strings), which the Azure Terraform provider depends upon. However, it doesn't appear that this is supported by the provider right now, which this issue is requesting. cc @tminhein
The options are set using a map of strings https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/azurerm/resource_arm_cosmosdb_sql_database.go (see line 75)
please explain with a sample. I've tried {througtput = 400}. it's not working.
Until this is not implemented, im using via azure template.
So is this ever going to be implemented? The cosmos terraform provider is useless if i cannot specify throughput. I would have to create a separate script to configure this
So is this ever going to be implemented? The cosmos terraform provider is useless if i cannot specify throughput. I would have to create a separate script to configure this
Is just like i mentioned above, im using the azurerm template provider.
So is this ever going to be implemented? The cosmos terraform provider is useless if i cannot specify throughput. I would have to create a separate script to configure this
Is just like i mentioned above, im using the azurerm template provider.
You can work around pretty much anything using a dreaded ARM template but this is really not ideal and negates the main advantages of terraform.
Any update on whether the throughout configuration will be included in future releases would be appreciated.
Very sad throughput cannot be controlled when deploying terraform. This is a critical issue as you cannot change the throughput configuration of a SQL Database once it has been deployed. It requires a drop / create.
This has been released in version 1.40.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:
provider "azurerm" {
version = "~> 1.40.0"
}
# ... other configuration ...
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!
Most helpful comment
You can work around pretty much anything using a dreaded ARM template but this is really not ideal and negates the main advantages of terraform.
Any update on whether the throughout configuration will be included in future releases would be appreciated.