confluentinc/terraform-provider-elasticsearch

Name: terraform-provider-elasticsearch

Owner: Confluent Inc.

Description: An elasticsearch provider for terraform

Forked from: phillbaker/terraform-provider-elasticsearch

Created: 2017-12-06 21:39:10.0

Updated: 2018-02-05 10:20:13.0

Pushed: 2017-12-05 04:01:49.0

Homepage: null

Size: 23

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

terraform-provider-elasticsearch

Build Status

This is a terraform provider that lets you provision elasticsearch resources, compatible with v5 of elasticsearch. Based off of an original PR to Terraform.

Installation

Download a binary, and put it in a good spot on your system. Then update your ~/.terraformrc to refer to the binary:

iders {
asticsearch = "/path/to/terraform-provider-elasticsearch"

See the docs for more information.

Usage
ider "elasticsearch" {
url = "https://search-foo-bar-pqrhr4w3u4dzervg41frow4mmy.us-east-1.es.amazonaws.com" # Don't include port at the end for aws
aws_access_key = ""
aws_secret_key = ""
aws_token = "" # if necessary
insecure = true # to bypass certificate check
cacert_file = "/path/to/ca.crt" # when connecting to elastic with self-signed certificate


urce "elasticsearch_index_template" "test" {
me = "terraform-test"
dy = <<EOF

emplate": "logstash-*",
ersion": 50001,
ettings": {
"index.refresh_interval": "5s"

appings": {
"_default_": {
  "_all": {"enabled": true, "norms": false},
  "dynamic_templates": [ {
    "message_field": {
      "path_match": "message",
      "match_mapping_type": "string",
      "mapping": {
        "type": "text",
        "norms": false
      }
    }
  }, {
    "string_fields": {
      "match": "*",
      "match_mapping_type": "string",
      "mapping": {
        "type": "text", "norms": false,
        "fields": {
          "keyword": { "type": "keyword" }
        }
      }
    }
  } ],
  "properties": {
    "@timestamp": { "type": "date", "include_in_all": false },
    "@version": { "type": "keyword", "include_in_all": false },
    "geoip" : {
      "dynamic": true,
      "properties": {
        "ip": { "type": "ip" },
        "location": { "type": "geo_point" },
        "latitude": { "type": "half_float" },
        "longitude": { "type": "half_float" }
      }
    }
  }
}





saved search, visualization or dashboard
urce "elasticsearch_kibana_object" "test_dashboard" {
dy = "${file("dashboard_path.txt")}"


urce "elasticsearch_kibana_object" "test_visualization" {
dy = <<EOF


"_id": "response-time-percentile",
"_type": "visualization",
"_source": {
  "title": "Total response time percentiles",
  "visState": "{\"title\":\"Total response time percentiles\",\"type\":\"line\",\"params\":{\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"showCircles\":true,\"interpolate\":\"linear\",\"scale\":\"linear\",\"drawLinesBetweenPoints\":true,\"radiusRatio\":9,\"times\":[],\"addTimeMarker\":false,\"defaultYExtents\":false,\"setYExtents\":false},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"percentiles\",\"schema\":\"metric\",\"params\":{\"field\":\"app.total_time\",\"percents\":[50,90,95]}},{\"id\":\"2\",\"enabled\":true,\"type\":\"date_histogram\",\"schema\":\"segment\",\"params\":{\"field\":\"@timestamp\",\"interval\":\"auto\",\"customInterval\":\"2h\",\"min_doc_count\":1,\"extended_bounds\":{}}},{\"id\":\"3\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"group\",\"params\":{\"field\":\"system.syslog.program\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"_term\"}}],\"listeners\":{}}",
  "uiStateJSON": "{}",
  "description": "",
  "version": 1,
  "kibanaSavedObjectMeta": {
    "searchSourceJSON": "{\"index\":\"filebeat-*\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}"
  }
}




Development
Requirements
sure that this folder is at the following location: `${GOPATH}/src/github.com/phillbaker/terraform-provider-elasticsearch`
GOPATH/src/github.com/phillbaker/terraform-provider-elasticsearch

e install
uild -o /path/to/binary/terraform-provider-elasticsearch
Licence

See LICENSE.

Contributing
  1. Fork it ( https://github.com/phillbaker/terraform-provider-elasticsearch/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.