Terraform-provider-azurerm: azurerm_cosmosdb_sql_container needs throughput and TTL settings

Created on 4 Nov 2019  ยท  8Comments  ยท  Source: terraform-providers/terraform-provider-azurerm

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

Description

The new azurerm_cosmosdb_sql_container in 1.34 is a welcome addition to the provider - but lacking in some key areas to make it viable for managing real infrastructure. Currently it does not include throughput settings or TTL configuration. Both of these are vital to managing cost and performance of a production instance of cosmos.

New or Affected Resource(s)

azurerm_cosmosdb_sql_container

Potential Terraform Configuration

resource "azurerm_cosmosdb_sql_container" "example" {
  name                = "example-container"
  resource_group_name = "${azurerm_cosmosdb_account.example.resource_group_name}"
  account_name        = "${azurerm_cosmosdb_account.example.name}"
  database_name       = "${azurerm_cosmosdb_sql_database.example.name}"
  partition_key_path  = "/definition/id"
  ttl                            = "1000"
  collection_throughput = "1000"

  unique_key {
    paths = ["/definition/idlong", "/definition/idshort"]
  }
}
# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.

References

https://github.com/terraform-providers/terraform-provider-azurerm/issues/548

enhancement serviccosmosdb

Most helpful comment

Fixed via #5203 which will ship as a part of v1.40 - thanks for the ping @ElvenSpellmaker

All 8 comments

related: #4620 #4309 #3623

would be fixed by #4616

hi all, any news on this?

I just bumped into this, it seems you can't specify the throughput at the DB level either. ๐Ÿค”

It seems #5203 will add this feature to both DB and Containers, we'll have to await a release ๐Ÿ™‚

Fixed via #5203 which will ship as a part of v1.40 - thanks for the ping @ElvenSpellmaker

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

Really glad this got merged in, this will help us move to using terraform for container management.

Will this now allow for non-destructive changes to the throughput/ttl on apply?

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!

Was this page helpful?
0 / 5 - 0 ratings