Browse the Repo

file-type-icon.circleci
file-type-icon_docs
file-type-iconexamples
file-type-iconelasticsearch-docker
file-type-iconelasticsearch-only-cluster
file-type-iconelk-amis
file-type-iconall-in-one
file-type-iconapp-server
file-type-iconcollectd
file-type-iconelastalert
file-type-iconelasticsearch
file-type-iconaws
file-type-icondocker
file-type-iconplugins
file-type-iconreadonlyrest-config
file-type-iconREADME.md
file-type-iconelasticsearch-install-steps.sh
file-type-iconelasticsearch.json
file-type-iconfilebeat
file-type-iconkibana
file-type-iconlogstash
file-type-iconREADME.md
file-type-iconelk-multi-cluster
file-type-iconelk-single-cluster
file-type-iconmodules
file-type-icontest
file-type-icon.gitignore
file-type-icon.pre-commit-config.yaml
file-type-iconCODEOWNERS
file-type-iconCONTRIBUTING.md
file-type-iconLICENSE.md
file-type-iconREADME.md
file-type-iconterraform-cloud-enterprise-private-module-...

Browse the Repo

file-type-icon.circleci
file-type-icon_docs
file-type-iconexamples
file-type-iconelasticsearch-docker
file-type-iconelasticsearch-only-cluster
file-type-iconelk-amis
file-type-iconall-in-one
file-type-iconapp-server
file-type-iconcollectd
file-type-iconelastalert
file-type-iconelasticsearch
file-type-iconaws
file-type-icondocker
file-type-iconplugins
file-type-iconreadonlyrest-config
file-type-iconREADME.md
file-type-iconelasticsearch-install-steps.sh
file-type-iconelasticsearch.json
file-type-iconfilebeat
file-type-iconkibana
file-type-iconlogstash
file-type-iconREADME.md
file-type-iconelk-multi-cluster
file-type-iconelk-single-cluster
file-type-iconmodules
file-type-icontest
file-type-icon.gitignore
file-type-icon.pre-commit-config.yaml
file-type-iconCODEOWNERS
file-type-iconCONTRIBUTING.md
file-type-iconLICENSE.md
file-type-iconREADME.md
file-type-iconterraform-cloud-enterprise-private-module-...
Elasticsearch (self-hosted)

Elasticsearch (self-hosted)

Deploy a self-hosted Elasticsearch cluster. Supports automatic bootstrap, zero-downtime rolling deployment, auto healing, backup, and recovery.

Code Preview

Preview the Code

mobile file icon

README.md

down

Elasticsearch AMI

This folder shows an example of how to use Packer to create Amazon Machine Images (AMIs) or Docker Images that have Elasticsearch and its dependencies installed on top of:

  1. Ubuntu 16.04
  2. Ubuntu 18.04
  3. Amazon Linux 2

Quick start

To build the Elasticsearch AMI:

  1. git clone this repo to your computer.
  2. Install Packer.
  3. Configure your AWS credentials using one of the options supported by the AWS SDK. Usually, the easiest option is to set the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables.
  4. Update the variables section of the elasticsearch-ami.json Packer template to specify the AWS region and Elasticsearch version you wish to use.
  5. To build an Ubuntu AMI for Elasticsearch: packer build -only=elasticsearch-ami-ubuntu elasticsearch.json.
  6. To build an Amazon Linux AMI for Elasticsearch: packer build -only=elasticsearch-ami-amazon-linux elasticsearch.json.

Local testing

The Packer template in this example folder can build not only AMIs, but also Docker images for local testing. This is convenient for testing out the various scripts in the modules folder without having to wait for an AMI to build and a bunch of EC2 Instances to boot up.

  1. To build an Ubuntu Docker image for Elasticsearch: packer build -only=elasticsearch-docker-ubuntu elasticsearch.json.
  2. To build an Amazon Linux Docker image for Elasticsearch: packer build -only=elasticsearch-docker-amazon-linux elasticsearch.json.

For more information see elasticsearch-docker.

SSL AMIs and Docker Images

Our packer template also demonstrates how to build an AMI with Elasticsearch installed and configured to use the ReadonlyREST plugin to enable Elasticsearch to be accessed over HTTPS. If you don't override the default, the AMIs will be built in AWS region: us-east-1. You can override this by adding -var use_ssl=[the-region-you-need] to the commands below.

  1. To build an Ubuntu AMI with SSL enabled for Elasticsearch: packer build -var use_ssl=true -only=elasticsearch-ami-ubuntu elasticsearch.json.
  2. To build an Amazon Linux AMI with SSL enabled for Elasticsearch: packer build -var use_ssl=true -only=elasticsearch-ami-amazon-linux elasticsearch.json.

Questions? Ask away.

We're here to talk about our services, answer any questions, give advice, or just to chat.

Ready to hand off the Gruntwork?