After finding myself deploying Elasticsearch on the cloud for many clients who asked for help, I figured I should find a way to automate and simplify the process. It is now here for you to enjoy.
Using hosted Elasticsearch solutions is costly and some solutions really don't worth the premium you pay (looking at you, AWS Elasticsearch). And so I went to seek a solution that will allow to deploy and manage my own (or my clients') clusters easily without hassle, and without paying any premiums whatsoever.
The solution I came up with was to use Packer and Terraform - two great HashiCorp products - to create immutable machine images and then deploy them to a cluster of EC2 machines. Infrastructure as Code FTW.
The entire work, with documentation, can be found here: https://github.com/synhershko/elasticsearch-cloud-deploy/. High-level documentation follows.
Creating immutable images with Packer
"Packer is a tool for creating machine and container images for multiple platforms from a single source con...