8000 Elasticsearch provider · Issue #12651 · hashicorp/terraform · GitHub
[go: up one dir, main page]

Skip to content
Elasticsearch provider #12651
@haegrr

Description

@haegrr

It would be very useful if Terraform could manage Elasticsearch resources, such as indices, index templates, search templates, etc. I've started prototyping an implementation that covers my current needs, which are limited to index templates. Opening this issue to track API, work, feedback, etc.

I'm currently targeting Elasticsearch 5 and up.

Index templates

resource "elasticsearch_index_template" "test" {
  name = "terraform-test"
  template = "tf-*"
  order = 1

  settings {
    index.number_of_shards = 5
  }

  mapping {
    type = "reports"

    date_property {
      name = "created_at"
      format = "EEE MMM dd HH:mm:ss Z YYYY"
    }

    keyword_property {
      name = "subject"
    }
  }
}

API reference: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html

PUT _template/terraform-test

{
  "template": "tf-*",
  "order": 1,
  "settings": {
    "index.number_of_shards": 5
  },
  "mappings": {
    "reports": {
      "properties": {
        "created_at": {
          "type": "date",
          "format": "EEE MMM dd HH:mm:ss Z YYYY"
        },
        "subject": {
          "type": "keyword"
        }
      }
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0