How to create targets for dynamic host catalogs in AWS.
Like the documentation subjects to only host catalog creation , so how the targets should be added.
The target resources just use the plugin-defined host source(s) in their configuration – the idea is that the static target uses dynamically-updated host sources to achieve dynamic discovery.
So , do we need to add targets manually n then connect to the dynamic host catalogs, is this what you are trying to say?
That’s it exactly. If you have some Boundary targets that need to be present or absent in Boundary depending on whether some condition is true or not, one way you can do that is by deploying those target configurations with the Boundary Terraform provider and using conditionals to determine whether they actually are part of the configuration for any given apply — for example in one place in your Terraform code you can optionally deploy a service, and you can have a separate block representing a Boundary target that has a conditional that only creates the target if the underlying service was created. (It’s not a pattern I recommend for production too much, because flipping a variable the wrong way can end up destroying actual infrastructure, but I do this for demo environments where in any given environment I may or may not want to deploy, say, a database or a Kubernetes cluster as part of the demo.)
The condition for the target’s existence could be something besides whether a service is present of course — in theory you can use any set of conditions that makes sense to you, for example you could have a target for weekend on-call access to things only be present on weekends by having a daily Terraform apply and using the current day of the week as the condition for the target’s existence. Just bear in mind that configurations like that depend on a Terraform apply to happen regularly enough for the condition to be evaluated as often as it needs to be.