phillbaker / terraform-provider-elasticsearch

An elasticsearch provider for terraform
https://registry.terraform.io/providers/phillbaker/elasticsearch
Mozilla Public License 2.0
306 stars 134 forks source link

Add possibility to increase timeout for index pattern creation #336

Open thomaschaaf opened 1 year ago

thomaschaaf commented 1 year ago

Creating an index pattern works but sadly the request times out and then the next time the provider tries to create it again.

resource "elasticsearch_kibana_object" "team_index_pattern" {
  for_each = toset([for team in local.teams : team])
  index    = "${lower(each.value)}-*"
  body     = <<EOF
[
  {
    "_id": "index-pattern:${lower(each.value)}-*",
    "_type": "_doc",
    "_source": {
      "type": "index-pattern",
      "index-pattern": {
        "title": "${lower(each.value)}-*",
        "timeFieldName": "@timestamp"
      }
    }
  }
]
EOF
}
2023-02-03T11:38:45.473+0100 [INFO]  provider.terraform-provider-elasticsearch_v2.0.7: 2023/02/03 11:38:45 [INFO] Failed to put kibana object: Put "https://vpc-XXX.eu-central-1.es.amazonaws.com/teamx-%2A/_doc/index-pattern%3Ateamx-%2A": net/http: request canceled (Client.Timeout exceeded while awaiting headers): timestamp=2023-02-03T11:38:45.472+0100

It would be great if we could increase the timeout. In the end the index pattern is created but it still doesn't find it and there is no way to import the index.

I'm using opensearch version 2.3.