hashicorp / boundary-plugin-aws

Boundary Host Plugin (AWS)
Mozilla Public License 2.0
13 stars 2 forks source link

feat: add host-set attribute 'only_default' #22

Open justenwalker opened 1 year ago

justenwalker commented 1 year ago

Add a new attribute to the plugin host-set named 'only_default' which is a boolean that, if set to true, will only include default ip and dns names from the ec2 instances it finds.

A default IP is defined as the primary value on the instance for each attribute. These would be the values that you see in the AWS Console as a column in list view or on the Details tab when selecting a specific instnace.

A feature like this is necessary to support dynamic node pools (ASGs) on EKS Clusters where there may be multiple nics attached, and multiple ips per nic; but the host is only listening for SSH connections on the primary NIC/Address. There isn't a good way to specify dynamically which ip to connect to for SSH connections; and it may pick the wrong one (like a pod IP).

It will fall back to the primary addresses on the first network device (device index = 0) if those are not set for some reason.