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

[BUG]After index pattern creation and it usage in OpenSearch diff occurs #224

Open
gartemiev opened this issue Dec 6, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@gartemiev
Copy link

What is the bug?

When I create an index pattern and start using it in OpenSearch I get diff in Terraform.

How can one reproduce the bug?

Create index pattern:
resource "opensearch_dashboard_object" "this" { body = <<EOF [ { "_id": "index-pattern:terraform-test", "_source": { "type": "index-pattern", "index-pattern": { "title": "terraform-test*", "timeFieldName": "timestamp" } } } ] EOF }
and run terraform apply.
Then go to OpenSearch discovery section - and use this index pattern for search.
Then run terraform plan and as a result diff will be:
`
~ resource "opensearch_dashboard_object" "this" {
~ body = jsonencode(
~ [
~ {
~ _source = {
~ index-pattern = {
- fields = jsonencode(
[
- {
- aggregatable = true
- count = 0
- esTypes = [
- "_id",
]
- name = "_id"
- readFromDocValues = false
- scripted = false
- searchable = true
- type = "string"
},
- {
- aggregatable = true
- count = 0
- esTypes = [
- "_index",
]
- name = "_index"
- readFromDocValues = false
- scripted = false
- searchable = true
- type = "string"
},
- {
- aggregatable = false
- count = 0
- name = "_score"
- readFromDocValues = false
- scripted = false
- searchable = false
- type = "number"
},
- {
- aggregatable = false
- count = 0
- esTypes = [
- "_source",
]
- name = "_source"
- readFromDocValues = false
- scripted = false
- searchable = false
- type = "_source"
},
- {
- aggregatable = false
- count = 0
- name = "_type"
- readFromDocValues = false
- scripted = false
- searchable = false
- type = "string"
},
- {
- aggregatable = false
- count = 0
- esTypes = [
- "text",
]
- name = "host"
- readFromDocValues = false
- scripted = false
- searchable = true
- type = "string"
},
- {
- aggregatable = true
- count = 0
- esTypes = [
- "keyword",
]
- name = "host.keyword"
- readFromDocValues = true
- scripted = false
- searchable = true
- subType = {
- multi = {
- parent = "host"
}
}
- type = "string"
},
- {
- aggregatable = false
- count = 0
- esTypes = [
- "text",
]
- name = "message"
- readFromDocValues = false
- scripted = false
- searchable = true
- type = "string"
},
- {
- aggregatable = true
- count = 0
- esTypes = [
- "keyword",
]
- name = "message.keyword"
- readFromDocValues = true
- scripted = false
- searchable = true
- subType = {
- multi = {
- parent = "message"
}
}
- type = "string"
},
- {
- aggregatable = false
- count = 0
- esTypes = [
- "text",
]
- name = "source"
- readFromDocValues = false
- scripted = false
- searchable = true
- type = "string"
},
- {
- aggregatable = true
- count = 0
- esTypes = [
- "keyword",
]
- name = "source.keyword"
- readFromDocValues = true
- scripted = false
- searchable = true
- subType = {
- multi = {
- parent = "source"
}
}
- type = "string"
},
- {
- aggregatable = false
- count = 0
- esTypes = [
- "text",
]
- name = "source_type"
- readFromDocValues = false
- scripted = false
- searchable = true
- type = "string"
},
- {
- aggregatable = true
- count = 0
- esTypes = [
- "keyword",
]
- name = "source_type.keyword"
- readFromDocValues = true
- scripted = false
- searchable = true
- subType = {
- multi = {
- parent = "source_type"
}
}
- type = "string"
},
- {
- aggregatable = false
- count = 0
- esTypes = [
- "text",
]
- name = "tag"
- readFromDocValues = false
- scripted = false
- searchable = true
- type = "string"
},
- {
- aggregatable = true
- count = 0
- esTypes = [
- "keyword",
]
- name = "tag.keyword"
- readFromDocValues = true
- scripted = false
- searchable = true
- subType = {
- multi = {
- parent = "tag"
}
}
- type = "string"
},
- {
- aggregatable = true
- count = 0
- esTypes = [
- "date",
]
- name = "timestamp"
- readFromDocValues = true
- scripted = false
- searchable = true
- type = "date"
},
]
)
# (2 unchanged attributes hidden)
}
- updated_at = "2024-12-06T08:39:09.240Z"
# (1 unchanged attribute hidden)
}
# (1 unchanged attribute hidden)
},
]
)
id = "index-pattern:terraform-test"
# (1 unchanged attribute hidden)
}

Plan: 0 to add, 1 to change, 0 to destroy.
`

What is the expected behavior?

No diff should happen from the side of Terraform after index usage.

What is your host/environment?

Provider version is: 2.3.1
AWS OpenSearch version: v2.15.0

@dblock
Copy link
Member

dblock commented Jan 6, 2025

[Catch All Triage - 1, 2, 3, 4, 5, 6]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants