Introduction:
Filtering the appropriate host/s is necessary on their dedicated "Host catalogs" or within a single "Host Catalog" via different "Host Sets".
To achieve this setup, a concept of "filters" is introduced which works as explained in the next section.
Please note that this article covers the "AWS dynamic host catalogs" predominantly. The "Azure dynamic host catalogs" filter expressions are defined differently than AWS.
Explanation:
The below screenshot from "Host Set details" says, that only sync those hosts which have:-
- the "owner" OR "team" Key
- the "Name" Key
- a Key name "application" with its Value as "production", and
- "crown" as the Value of any Key
# corresponding CLI command
% boundary host-sets create plugin -host-catalog-id <host_catalog_id> -attr filters=tag-key=owner,team -attr filters=tag-key=Name -attr filters=tag:application=production -attr filters=tag-value=crown
So, the instances matching the following tags must sync as "Hosts" in the "Host Set" of the "Dynamic Host Catalog":
Please note that the value for the Key "Name", "owner", and "team", and the key of Value "crown" can be anything here because we're not filtering the instances based on their AWS Tag Key and Value in this example but there will be several combinations that can be used. However the "Key":"Value" pair "application":"production" is a must in this case.