Prevent an ES Node from joining a cluster based on an EC2 Tag?

I've got my elasticsearch.yml file set to filter ec2 nodes during discovery
based on a group and a tag. I use the same security group for all my ES
nodes ( jsut filtering other running servers in my account ) and thus, when
I want to run a separate cluster, I assign a new value to a tag called
'index'.

discovery.type: ec2
discovery.ec2.groups: elasticsearch_node
discovery.ec2.tag.index: companies

My problem is that if I spin up a new Node Instance and assign a unique
value to the 'index' tag during launch, this node still joins the running
cluster because although the tag is different, the cluster.name in it's
elasticsearch.yml file still matches the currently running cluster. It
seems the tag filter only filters nodes during the discovery process (
which makes sense ), but not when a new node is looking for clusters to
join.

Is there a preferred way to deal with this use case? Could the AWS Gateway
be configured to check the discovery.ec2.tag.key setting for a running
cluster before a new node joins that cluster?

--

Brian Jones wrote:

My problem is that if I spin up a new Node Instance and assign a
unique value to the 'index' tag during launch, this node still
joins the running cluster because although the tag is different,
the cluster.name in it's elasticsearch.yml file still matches the
currently running cluster. It seems the tag filter only filters
nodes during the discovery process ( which makes sense ), but not
when a new node is looking for clusters to join.

Forgive me if I missed this from your message, but why can you not
provision a different cluster name for the new nodes? Why do you
want nodes that share a cluster name not to be clustered together?

-Drew

--