elasticsearch

package module
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2019 License: MPL-2.0 Imports: 12 Imported by: 0

README

Terraform provider for elasticsearch

A Terraform plugin that provides resources for elasticsearch

Build Status

Install

  • Download the latest release for your platform.
  • Rename the executable to terraform-provider-elasticsearch

Provider Configuration

Example
provider "elasticsearch" {
  url        = "http://localhost:9200"
  es_version = "v5"
}

or

provider "elasticsearch" {}
Reference
  • url - (Required) Endpoint of elasticsearch
  • es_version - (Default v5) Version of elasticsearch

Resources

elasticsearch_index_template

Configure a Elasticsearch index template.

Example
resource "elasticsearch_index_template" "foobar" {
    name         = "template1"
	template = <<EOF
{
  "template": "access_log-*",
  "mappings": {
    "nginx": {
      "properties": {
        "timestamp": {
          "type": "date",
          "format":"date_time_no_millis"
        }
	  }
	}
  }
}
EOF
}

Build

$ make build

Testing

$ ELASTICSEARCH_URL="http://127.0.0.1:9200" ELASTICSEARCH_VERSION=v5 make testacc

Licence

Mozilla Public License, version 2.0

Author

KOJIMA Kazunori

Documentation

Index

Constants

View Source
const (
	// ElasticsearchURL endpoint
	ElasticsearchURL = "ELASTICSEARCH_URL"
	// ElasticsearchVersion major version, it should be prefixed "v"
	ElasticsearchVersion = "ELASTICSEARCH_VERSION"
)

Variables

This section is empty.

Functions

func Provider

func Provider() terraform.ResourceProvider

Provider returns a terraform.ResourceProvider.

Types

type Clients added in v0.0.6

type Clients struct {
	V5Client *v5.Client
	V6Client *v6.Client
	Version  int
}

type Config

type Config struct {
	URL     string
	Version string
}

Config ...

func (*Config) NewClient

func (c *Config) NewClient() (*Clients, error)

NewClient ...

type IndexTemplateDoc

type IndexTemplateDoc struct {
	Settings IndexTemplateSetting            `json:"settings"`
	Mappings map[string]IndexTemplateMapping `json:"mappings"`
	Template string                          `json:"template"`
	Order    uint                            `json:"order"`
}

type IndexTemplateMapping

type IndexTemplateMapping struct {
	Properties map[string]interface{} `json:"properties"`
	Source     map[string]interface{} `json:"_source,omitempty"`
	All        map[string]interface{} `json:"_all,omitempty"`
}

type IndexTemplateSetting added in v0.0.4

type IndexTemplateSetting struct {
	NumberOfShards int `json:"number_of_shards"`
}

Directories

Path Synopsis
builtin

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL