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

default_ttl_seconds = -1 doesn't create _ts index with options expireAfterSeconds: -1 #16306

Closed
1 task done
ghost opened this issue Apr 8, 2022 · 3 comments
Closed
1 task done

Comments

@ghost
Copy link

ghost commented Apr 8, 2022

Is there an existing issue for this?

  • I have searched the existing issues

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

Terraform Version

0.14.8

AzureRM Provider Version

2.77.0

Affected Resource(s)/Data Source(s)

azurerm_cosmosdb_mongo_collection

Terraform Configuration Files

resource "azurerm_cosmosdb_mongo_collection" "collection_name" {
  name                = "collection_name"
  resource_group_name = xxxx
  account_name        = xxxx
  database_name       = xxxx

  default_ttl_seconds = -1

  index {
    keys = ["_id"]
    unique = true
  }

}

Debug Output/Panic Output

n/a

Expected Behaviour

There should be _ts index created, together with options expireAfterSeconds: -1. This is important, because this is the way how Cosmos for Mongo API supports per document based ttl feature. Basically, by default all documents will never expire, but only the specific documents given ttl with positive value will expire and be removed.

Index _ts will like as follow:

"indexes": [
      {
        "key": {
          "keys": [
            "_id"
          ]
        },
        "options": null
      },
      {
        "key": {
          "keys": [
            "_ts"
          ]
        },
        "options": {
          "expireAfterSeconds": -1,
          "unique": null
        }
      }
    ],

Actual Behaviour

However, Terraform is ignore this, even though explicitly configured with default_ttl_seconds = -1, there is no _ts index is created.

"indexes": [
      {
        "key": {
          "keys": [
            "_id"
          ]
        },
        "options": null
      }
    ],

Steps to Reproduce

No response

Important Factoids

No response

References

No response

@ghost ghost added the bug label Apr 8, 2022
@github-actions github-actions bot removed the bug label Apr 8, 2022
@sinbai
Copy link
Contributor

sinbai commented Apr 12, 2022

@zakamai thank you for posting your issue here. This issue has been fixed by PR #15736 and released in v3.0.0 of the Terraform Provider. Could you upgrade the azurerm provider to see whether you are unblocked?

@ghost
Copy link
Author

ghost commented Apr 12, 2022

Thanks @sinbai I will close this one for now.

@ghost ghost closed this as completed Apr 12, 2022
@github-actions
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants