Opster is committed to the continuous improvement of open source technologies and sees the need for new tools for running OpenSearch. In this guide, we will be sharing a new Terraform module we built for installing OpenSearch clusters in AWS.
What you need for installing OpenSearch on EC2
You can choose whether to deploy the cluster in one of your existing VPCs or create a new VPC to deploy the cluster in.
Note that in order for the module to succeed, you must have a route-53 resource that connects to your VPC. This is needed for the node discovery.
These are the variables you will need to set and update in order to deploy the cluster in the root folder on main.tf file:
cluster_name = "opensearch-cluster" key_name =
create_vpc = vpc_id = subnet_id = route53_zone = route53_domain = Path_to_data =
If you want you can also change more variables as you wish in modules/opensearch/variables but we recommend keeping some of these variables at their default settings, including:
- Ami = Centos7, should be kept that way because the installation script adjusted to this OS.
- Instance_type = if you want to change it, please keep the ec2’s with at least 8 GB ram.
Here you can also change the architecture of your environment and add more nodes, just keep in mind that you will always need at least 1 data node, 1 master and 1 dashboard. If you choose to add more nodes, do not forget to add those hosts to the OpenSearch conf file on source/conf_setup (see more details on README.md file).
The variables we recommend changing are:
How to deploy your new OpenSearch cluster
After setting all the variables, run the following 3 commands in the root main.tf directory to deploy the cluster:
terraform init terraform plan terraform apply
Follow the execution output and wait a few minutes for the cluster to appear. This is the the message you’ll see confirming that the cluster has been created:
Apply complete! Resources: 10 added, 0 changed, 0 destroyed.
It will take more or less 10 minutes for the cluster to finish its initialization process & bootstrap checks and become available for use.
To check that the cluster is up, running, and available, you can run the following command and wait for a 200-ok response.
curl -XGET https://master-opensearch.domain.com:9200 -u 'admin:admin' --insecure
That’s it! Your cluster is up and running. In order to access OpenSearch Dashboards you can go in your browser to dashboard-opensearch.
If you have any questions, you can follow the Terraform module in the github repo – see here. Feel free to open a ticket or a Pull Request if you want to contribute, and stay tuned – the Opster team is working on some very cool and valuable OpenSearch additions, coming soon!