fix opensearch index_patterns deletion
package aiven
import (
+ "strings"
"time"
"github.com/aiven/terraform-provider-aiven/aiven/templates"
@@ -22,7 +23,12 @@ func opensearchSchema() map[string]*schema.Schema {
MaxItems: 1,
Optional: true,
Description: "Opensearch user configurable settings",
- DiffSuppressFunc: emptyObjectDiffSuppressFunc,
+ DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
+ if strings.Contains(k, "index_patterns") {
+ return false
+ }
+ return emptyObjectDiffSuppressFunc(k, old, new, d)
+ },
Elem: &schema.Resource{
Schema: GenerateTerraformUserConfigSchema(
templates.GetUserConfigSchema("service")[ServiceTypeOpensearch].(map[string]interface{})),
