We all want to utilize the awesome powers of Elasticsearch, but the number of plugins, configurations, and labyrinthine documentation creates a giant roadblock for getting started.

In GCP(Google Cloud Platform), there are only a few options to get started with Elasticsearch at the moment: use hosted SaaS in Elastic or one of the offerings in the marketplace. Both options have drawbacks and I intend to show my approach on how to get started and see some results fast while remaining in full control of your deployment.

Later you can absorb the details in the documentation and get a deep understanding at your own pace. This article is by no means a description of a perfect setup of an Elasticsearch cluster, it’s intended more as a way to get all the tools you need up and running fast in a smooth way, then it’s up to you to modify the scripts according to your own use case. I’ve been working in GCP, but these examples should be applicable in any cloud environment.

Elasticsearch, Kibana, Logstash, and all associated plugins are open-source, so the only cost is the VMs (virtual machines) and infrastructure running in GCP or any other cloud environment.

Terraform is perfect for automizing deployments since you can tear down and spin up VMs and infrastructure in a matter of minutes with a single command.


1. Terraform

1.1. Virtual machines

First of all, we need the VMs running Elasticsearch:

There is a lot happening here. You can choose how many machines you’d like to deploy by iterating over the above snippet. The most interesting is the startup script that I call ./startup-elastic.sh. We will get back to this topic in section 2.

#automation #terraform #kibana #google-cloud-platform #elasticsearch

Automate Elasticsearch deployment in GCP with Terraform
15.90 GEEK