When using an Elasticsearch cluster spread across multiple EC2 availability zones, it makes sense to ensure that replica shards are always in a different availability zone than the corresponding primary shard.
While not 100% guaranteed, AWS designs availability zones to be generally independent in terms of outages, so it can make a cluster much more resilient against failure.
This PR uses the EC2 Discovery plugin to set the availability attribute on each node, and then use shard allocation awareness on the availability zone property to ensure shards are well distributed.
When using an Elasticsearch cluster spread across multiple EC2 availability zones, it makes sense to ensure that replica shards are always in a different availability zone than the corresponding primary shard.
While not 100% guaranteed, AWS designs availability zones to be generally independent in terms of outages, so it can make a cluster much more resilient against failure.
This PR uses the EC2 Discovery plugin to set the availability attribute on each node, and then use shard allocation awareness on the availability zone property to ensure shards are well distributed.
Closes https://github.com/pelias/terraform-elasticsearch/issues/5