Boundary
GCP dynamic host catalogs
Boundary uses dynamic host catalogs to automatically discover GCP Compute Engine VM instances and add them as hosts.
You can authenticate to GCP using a service account, service impersonation, or the GCP Application Default Credentials (ADC):
To authenticate using the service account, create a service account in GCP and download the private key file.
The service account should have the following roles:
roles/compute.viewer
: (Required) To list Compute Engine VM instance in the project.roles/iam.serviceAccountKeyAdmin
: (Optional) To rotate the service account key ifdisable_credential_rotation
is set tofalse
.
Note
If you downloaded the private key from GCP, it may contain extra /n
characters that cause an error.
You can use jq
to remove the extra /n
characters.
Create a host catalog to connect with GCP
Boundary uses plugins to integrate with a variety of providers.
To use a dynamic host catalog to integrate with GCP, you create a host catalog of the plugin
type and set the plugin-name
value to gcp
.
You must also provide the specific fields needed for Boundary to authenticate with GCP. The required fields depend on whether you authenticate using the service account, service impersonation, or the GCP Application Default Credentials (ADC).
Complete the following steps to create a dynamic host catalog for GCP:
Log in to Boundary.
Select the org, and then select the project you want to create a host catalog for.
Select Host Catalogs.
Select New Host Catalog.
Complete the following fields:
- Name: (Optional) An optional description of the host catalog for identification purposes. If you enter a name, it must be unique.
- Description: (Optional) An optional description of the host catalog for identification purposes.
- Type: (Required) Select Dynamic to create a dynamic host catalog.
- Provider: (Required) Select GCP to create a dynamic host catalog for your GCP resources.
Project ID: (Required) The project ID of any instances that you want to add to the host catalog.
Zone: (Required) The GCP zone of the instances that you want to add to the host catalog.
Client Email: The unique email address that is used to identify the service account. It is required when you authenticate using the service account.
Target Service Account ID: Skip this field when you configure authentication using the service account. It is only used when you authenticate using service account impersonation.
Private Key ID: The unique identifier of the private key. It is required when you authenticate using the service account.
Private Key: The private key used to obtain an OAuth 2.0 access token. The key must be PEM encoded. It is required when you authenticate using the service account.
If you downloaded the private key from GCP, it may contain extra
/n
characters that cause an error. You can usejq
to remove the extra/n
characters.
- Worker Filter: (Optional) An optional filter to route requests to a designated worker.
- Disable credential rotation: (Optional) When enabled, Boundary does not rotate the credentials with GCP automatically.
Select Save.
Create a host set to connect with GCP
Host sets specify which GCP filters Boundary should use to identify which discovered hosts that should be added as members.
Complete the following steps to create a host set:
Log in to Boundary.
Select the org, and then select the project you want to create a host set for.
Select Host Catalogs.
Select the dynamic host catalog to which you want to add a host set.
Click the Host Sets tab, and then click New.
Complete the following fields:
- Name: (Optional) An optional name for identification purposes. If you enter a name, it must be unique.
- Description: (Optional) An optional description of the host catalog for identification purposes.
Click Save.