-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Add composite indexes support to CosmosDB SQL container #8792
Add composite indexes support to CosmosDB SQL container #8792
Conversation
@tombuildsstuff I think this should be ready for a review now. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @favoretti
Thanks for pushing those changes - taking a look through I've left a couple of other comments but this otherwise LGTM 👍
Thanks!
Co-authored-by: Tom Harvey <tombuildsstuff@users.noreply.github.com>
Co-authored-by: Tom Harvey <tombuildsstuff@users.noreply.github.com>
Co-authored-by: Tom Harvey <tombuildsstuff@users.noreply.github.com>
Co-authored-by: Tom Harvey <tombuildsstuff@users.noreply.github.com>
Co-authored-by: Tom Harvey <tombuildsstuff@users.noreply.github.com>
@tombuildsstuff Thank you, great comments for me to learn off. Committed all. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two minor things but this is otherwise good 👍
Co-authored-by: Tom Harvey <tombuildsstuff@users.noreply.github.com>
Co-authored-by: Tom Harvey <tombuildsstuff@users.noreply.github.com>
Hi @favoretti - I had a quick pass at fixing up a couple items to try and get this into today's release, but it looks like there's a casing bug in the API for reading back the |
@jackofallops ouch, that's not good. As a workaround we can just lowercase it all over the place when comparing? |
Probably best to check the string value in the flatten and set the correctly cased value for the state there? Test output (clipped) demonstrating the issue:
|
@jackofallops Would something like this work? index a2539bf50..eaa5e2c4c 100644
--- a/azurerm/internal/services/cosmos/common/indexing_policy.go
+++ b/azurerm/internal/services/cosmos/common/indexing_policy.go
@@ -2,6 +2,7 @@ package common
import (
"fmt"
+ "strings"
"github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2020-04-01/documentdb"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
@@ -123,7 +124,7 @@ func flattenCosmosDBIndexingPolicyCompositeIndex(input []documentdb.CompositePat
block := make(map[string]interface{})
block["path"] = path
- block["order"] = v.Order
+ block["order"] = strings.Title(string(v.Order))
indexPairs = append(indexPairs, block)
} If you're ok with it - I'll push. |
At first glance that should be OK, would be worth running the |
@jackofallops Seems to work:
|
This has been released in version 2.33.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 = "~> 2.33.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 👉 hashibot-feedback@hashicorp.com. Thanks! |
Fixes #8762