# Terraform + ec2 discovery (AWS) initial master s

**URL:** https://discuss.elastic.co/t/terraform-ec2-discovery-aws-initial-master-s/304385
**Category:** Elasticsearch
**Created:** [May 10, 2022, 7:00pm UTC](https://discuss.elastic.co/t/terraform-ec2-discovery-aws-initial-master-s/304385 "2022-05-10T19:00:37Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![hunsw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hunsw/32/93637_2.png) [@hunsw](https://discuss.elastic.co/u/hunsw)
#### Post date: [May 10, 2022, 7:00pm UTC](https://discuss.elastic.co/t/terraform-ec2-discovery-aws-initial-master-s/304385/1 "2022-05-10T19:00:37Z")

</div>

I'd like to create a small ES cluster in AWS with Terraform.

Does anybody have prior experience/a working example where Terraform instantiates 3 master nodes that can connect to each other?

The problem is that for bootstrapping the cluster a list of initial master nodes has to be provided, but I'm not sure how this can be done in Terraform where the IPs or the hostnames of the soon-to-be master nodes are unknown,

Any help is appreciated, thank you!

Edit: I would prefer to use an own version instead of a high level ES module...

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [June 7, 2022, 7:00pm UTC](https://discuss.elastic.co/t/terraform-ec2-discovery-aws-initial-master-s/304385/2 "2022-06-07T19:00:50Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
