I am trying to create a service resolver that will matches az3 if the condition
filter = "Service.Meta.instance_id == Node.Meta.instance_id"
is met, see below for full HCL file:
kind = "service-resolver"
name = "web"
default_subset = "az1"
subsets = {
az1 = {
filter = "Service.Meta.az == 2a"
}
az2 = {
filter = "Service.Meta.az == 2b"
}
az3 = {
filter = "Service.Meta.instance_id == Node.Meta.instance_id"
}
}
However this does not appear to work. As per the documentation Filtering | Consul by HashiCorp, Values can also be Selectors.
Interestingly if I do the following:
filter = "Service.Meta.instance_id == `i-123456`"
or
filter = "Node.Meta.instance_id == `i-123456`"
it resolves healthy instances of the “web” service.
Any ideas what I might be doing wrong?