Need help with terraform-provider-elasticsearch?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

phillbaker
168 Stars 70 Forks Mozilla Public License 2.0 195 Commits 25 Opened issues

Description

An elasticsearch provider for terraform

Services available

!
?

Need anything else?

Contributors list

# 47,038
Ruby
Objecti...
migrate
faceid
116 commits
# 272,627
bitbuck...
puppet
HTML
applica...
5 commits
# 364,650
Python
sentry
crash-r...
Go
4 commits
# 213,615
git-hoo...
cloudwa...
HTML
React
4 commits
# 564,818
Shell
JavaScr...
Haskell
3 commits
# 155,519
nix
Haskell
OpenCV
ghcjs
3 commits
# 403,446
aws-lam...
slack
aws-clo...
apache2
3 commits
# 196,622
actived...
guides
Terrafo...
automat...
3 commits
# 436,720
JavaScr...
HTML
alfy
Visual ...
3 commits
# 600,064
Python
Shell
HTML
2 commits
# 256,134
Shell
Go
elastic...
2 commits
# 474,792
Shell
Go
terrafo...
Terrafo...
1 commit
# 210,926
Shell
TypeScr...
aes
sso
1 commit
# 444,047
HTML
JavaScr...
devops-...
version...
1 commit
# 596,258
Shell
HTML
JavaScr...
1 commit
# 168,483
HTML
Kuberne...
JavaScr...
Shell
1 commit
# 666,679
HTML
Kuberne...
gitops
helm
1 commit
# 99,494
lambda
JavaScr...
golang
podman
1 commit
# 447,852
Shell
C++
Python
1 commit
# 51,732
Go
python3
serverl...
aws-lam...
1 commit

terraform-provider-elasticsearch

Test

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

Installation

This package is published on the official Terraform registry.

Or download a binary, and put it in a good spot on your system. Then update your

~/.terraformrc
to refer to the binary:
providers {
  elasticsearch = "/path/to/terraform-provider-elasticsearch"
}

See the docs for more on manual installation.

Usage

provider "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
    sign_aws_requests = true # only needs to be true if your domain access policy includes IAM users or roles
}

API Coverage

Examples of resources can be found in the examples directory. The resources currently supported from the: opensource Elasticsearch, XPack and OpenDistro distributions are described below.

Elasticsearch

Kibana

  • [x] Kibana Object
    • [ ] Visualization
    • [ ] Search
    • [ ] Dashboard

XPack

OpenDistro

Examples

resource "elasticsearch_index_template" "test" {
  name = "terraform-test"
  body = <

Example watches (target notification actions must be setup manually before hand)

# Monitor cluster status with auth being required
resource "elasticsearch_xpack_watch" "cluster-status-red" {
  watch_id = "cluster-status-red"
  body = < node.jvm.mem.heap_used_percent > 75)"
    }
  },
  "actions": {
    "notify-slack": {
      "throttle_period_in_millis": 600000,
      "slack": {
        "account": "monitoring",
        "message": {
          "from": "watcher",
          "to": [
            "#my-slack-channel"
          ],
          "text": "Elasticsearch Monitoring",
          "attachments": [
            {
              "color": "danger",
              "title": "JVM Memory Pressure Warning",
              "text": "JVM Memory Pressure has been > 75% on one or more nodes for the last 5 minutes."
            }
          ]
        }
      }
    }
  },
  "metadata": {
    "xpack": {
      "type": "json"
    },
    "name": "JVM Memory Pressure Warning"
  }
}
EOF
}

For use with AWS Elasticsearch domains

Please see the documentation for details.

Development

Requirements

go build -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

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.