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

Cosmosdb indexing policy capitalization #16086

Closed
noiano opened this issue Mar 27, 2022 · 6 comments
Closed

Cosmosdb indexing policy capitalization #16086

noiano opened this issue Mar 27, 2022 · 6 comments

Comments

@noiano
Copy link

noiano commented Mar 27, 2022

After upgrading to version v3.0.2 due to the fix of #16068 I noticed a strage behaviour, this time affecting cosmodb resources. Even after a successful apply, just by running terraform apply again, I see terraform trying to capitalize the indexing_policy over and over again.

 ~ indexing_policy {
        ~ indexing_mode = "consistent" -> "Consistent"

          # (1 unchanged block hidden)
      }

I mean it's no biggie given that it doesn't seem to do much ... It's just an annoyance 😄

Terraform (and AzureRM Provider) Version

Terraform v1.1.7
on darwin_amd64
+ provider registry.terraform.io/hashicorp/azuread v2.19.1
+ provider registry.terraform.io/hashicorp/azurerm v3.0.2
+ provider registry.terraform.io/hashicorp/helm v2.4.1
+ provider registry.terraform.io/hashicorp/kubernetes v2.9.0
+ provider registry.terraform.io/hashicorp/random v3.1.2
+ provider registry.terraform.io/hashicorp/tls v3.1.0

Affected Resource(s)

  • azurerm_cosmosdb_sql_container

Steps to Reproduce

  1. terraform apply or terraform plan

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
@katbyte
Copy link
Collaborator

katbyte commented Mar 28, 2022

Hi @noiano, sorry that your having this issue

As part of the 3.0 upgrade we are starting to move towards using the casing specified by the rest API specs and SDK. The provider should be validing the config is using that casing and transparently translating the API responses to casing used in the SDK. It looks like the SDK is using consistent for this property.

What casing are you using in your config? and what happens when you use consistent in your config?

@noiano
Copy link
Author

noiano commented Mar 29, 2022

Hello,
thank you for you answer. Switching to consistent

indexing_policy {
    indexing_mode = "consistent"

    included_path {
      path = "/*"
    }
  }

Solved the "problem" ... now terraform doesn't try capitalize the indexing policy any more. Are there any more of these changes? If so where can I find them?

Thank you for your time :)

@sinbai
Copy link
Contributor

sinbai commented Apr 6, 2022

@noiano thank you for opening this issue. I submitted a PR to fix this issue, setting case-sensitive for indexing_mode property of 3.0. The resources involved are azurerm_cosmosdb_sql_container and azurerm_cosmosdb_gremlin_graph. It is expected to release in the upcoming v3.1.0 release. Could you track it and let me know whether you are unblocked?

@sinbai
Copy link
Contributor

sinbai commented Apr 28, 2022

@noiano For the above context, are you okey if we close this issue?

@noiano
Copy link
Author

noiano commented Apr 28, 2022

Absolutely, thank you for checking in

@noiano noiano closed this as completed Apr 28, 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 29, 2022
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

4 participants