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

azurerm_cosmosdb_sql_container needs TTL settings #5451

Closed
md-waldron opened this issue Jan 20, 2020 · 2 comments · Fixed by #5492
Closed

azurerm_cosmosdb_sql_container needs TTL settings #5451

md-waldron opened this issue Jan 20, 2020 · 2 comments · Fixed by #5492

Comments

@md-waldron
Copy link

Description

Currently there is no setting in azurerm_cosmosdb_sql_container for TTL configuration. This is a key feature of CosmosDb collections and without it the TTL overrides at the item level cannot be set.
https://docs.microsoft.com/en-us/azure/cosmos-db/time-to-live

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

  unique_key {
    paths = ["/definition/idlong", "/definition/idshort"]
  }
}

References

This was mentioned in a previously closed issue. The resolution only addressed part of the issue (throughput) but sadly not the TTL part.
#4802

@aqche
Copy link
Contributor

aqche commented Jan 22, 2020

taking a look into this. will have a PR up shortly!

katbyte pushed a commit that referenced this issue Jan 25, 2020
Fixes #5451

Adds the default_ttl argument for the azurerm_cosmosdb_sql_container resource.

Also, fixes a bug causing resource updates to fail since id.Container was being passed in instead of id.ResourceGroup for one of the function arguments.
@ghost
Copy link

ghost commented Mar 28, 2020

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!

@ghost ghost locked and limited conversation to collaborators Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants