ยปManage Targets
Targets are Boundary resources which contain one or more Host Sets. A target allows Boundary users to define an endpoint with a default port and a protocol to establish a session. Unless specified with a -host-id
flag, Boundary will choose one Host in the host set to connect to at random.
In this section, we'll show you the basics of how to define a host, host set, and a target in Boundary on the CLI, the admin console, and using our Terraform provider.
We assume you're running Boundary in dev
mode and have a default static host-catalog of hcst_1234567890
. We also assume you've logged in on the command line and the admin console. See the output of boundary dev
for these login values.
Note that all resource IDs in this example are illustration only - IDs are uniquely generated for every resource upon creation with the exception being
generated resources in dev
mode. Please make sure to use the resource IDs that are generated when running this example. For example, if you run
boundary users create
, use the resource ID of the user seen in stdout, not the ID in the example command.
Define a Host
For this example, we're going to create a target to access postgres on localhost
. This assumes a couple of things:
- The host address is
127.0.0.1
- The target port is
:5432
Define a Host Set
Host sets allow us to group hosts providing equivalent services together. A target works off of host sets, so even though we are only defining one host in this example, we're going to create a host set of one host.
Define a Target