docs: IA reorganization (#5838)
* docs: IA reorganization * docs: Updates * docs: Updates * docs: Fix links * docs: Updates * docs: Fix a typo * docs: Fix client agent topic * docs: Update Client Agent nav * docs: Fix conflict * docs: Fix a typo in Client Agent docs (#5853) * docs: Fix client agent topic * docs: Updates * docs: Updates * docs: Updates * docs: Updates * docs: Fixes get started and operations links * docs: Update nav * docs: Partials * docs: Unix partials * docs: Worker partials * docs: Updates * docs: Update workers and targets * docs: Updates * docs: Updates * docs: Fixes link * docs: Updates after sync review * docs: Updates from review feedback * docs: Move worker filter examples * docs: Fix links * docs: Updates for filters based on working session * docs: Fixes broken links * docs: Add links to other filter topics * docs: Update list intro * docs: Adds link * docs: Fixes redirects * docs: Fixes redirects * docs: Deleted mysql page from TOC * docs: Add versioned redirect * docs: Adds versioned redirects * docs: Adds versioned redirects * docs: Update redirects * docs: Update redirects * docs: Redirect fixes * docs: Update redirect format * docs: Fix a typo * docs: Fixes redirects * docs: Fixes redirect * docs: Adds links out to client agent troubleshooting * uses /etc/boundary.d/ as recommended installation directory (#6003) * docs: Updates legacy io links * docs: Fixes redirects * docs: Fix redirect * docs: Restoring deleted file --------- Co-authored-by: Robin Beck <stellarsquall@users.noreply.github.com>
This commit is contained in:
1 parent
21fce7c5eb
commit
5ce6515156
253 files changed
+7897
-5673
No files matched your search
@@ -0,0 +1,394 @@
|
||||
---
|
||||
layout: docs
|
||||
page_title: AWS dynamic host catalogs
|
||||
description: >-
|
||||
Use dynamic host catalogs to automatically discover AWS EC2 instances and add them as hosts. Create a host catalog and host set for AWS resources.
|
||||
---
|
||||
# AWS dynamic host catalogs
|
||||
Boundary uses dynamic host catalogs to automatically discover AWS EC2 instances and add them as hosts.
|
||||
|
||||
## Create a host catalog to connect with AWS
|
||||
Boundary uses plugins to integrate with a variety of providers. To use
|
||||
a dynamic host catalog to integrate with AWS, you create a host catalog of the `plugin` type
|
||||
and set the `plugin-name` value to `aws`. You must also provide the specific
|
||||
fields needed for Boundary to authenticate with AWS.
|
||||
|
||||
Boundary supports two methods of authenticating to AWS:
|
||||
|
||||
1. **Static credentials** using an IAM user and its access key
|
||||
1. **Dynamic credentials** using credentials generated by `AssumeRole`
|
||||
|
||||
HashiCorp recommends using dynamic credentials when possible. Select a credential type to continue:
|
||||
|
||||
<Tabs>
|
||||
<Tab heading="Static credentials" group="static">
|
||||
|
||||
### Required IAM Privileges
|
||||
|
||||
Boundary needs the following IAM privileges, at the very least, to be attached to a configured IAM user.
|
||||
|
||||
Configure `DescribeInstances` to `*`. `DescribeInstances` cannot be scoped to a resource ARN.
|
||||
|
||||
Example policy:
|
||||
|
||||
```json
|
||||
{
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Action": [
|
||||
"ec2:DescribeInstances"
|
||||
],
|
||||
"Effect": "Allow",
|
||||
"Resource": "*"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
To allow static credential rotation, add the `iam:GetUser`, `iam:CreateAccessKey`, and `iam:DeleteAccessKey` policies:
|
||||
|
||||
```json
|
||||
{
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Action": [
|
||||
"iam:DeleteAccessKey",
|
||||
"iam:GetUser",
|
||||
"iam:CreateAccessKey"
|
||||
],
|
||||
"Effect": "Allow",
|
||||
"Resource": "arn:aws:iam::123456789012:user/JohnDoe"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab heading="Dynamic credentials" group="dynamic">
|
||||
|
||||
<Note>
|
||||
|
||||
[Cross-account access](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies-cross-account-resource-access.html) for AWS IAM roles is not currently supported.
|
||||
|
||||
</Note>
|
||||
|
||||
This feature requires a self-managed Boundary [worker](/boundary/docs/deploy/self-managed/deploy-workers).
|
||||
|
||||
To set up a dynamic host catalog using an AWS role, a self-managed worker must assume the role. You must assign the role to the self-managed worker AWS instance, and then supply a worker filter that matches the AWS worker when you set up the dynamic host catalog.
|
||||
|
||||
Perform the following steps to set up a host catalog using [AssumeRole](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html):
|
||||
|
||||
1. Deploy a self-managed worker in your AWS account. The worker must be in the same VPC as the hosts you want to access using the dynamic host catalog. Consider [adding worker tags](/boundary/docs/workers/worker-tags) to make it easier to route traffic through it using a worker filter later on.
|
||||
|
||||
1. Create an IAM role with the `AmazonEC2ReadOnlyAccess` policy attached, or define a custom policy with the `ec2:DescribeInstances` action allowed for all resources. This policy should contain the following, at least:
|
||||
|
||||
```json
|
||||
{
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Action": [
|
||||
"ec2:DescribeInstances"
|
||||
],
|
||||
"Effect": "Allow",
|
||||
"Resource": "*"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Refer to the AWS [Create a role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user.html) documentation to learn more.
|
||||
|
||||
1. Attach the role to the IAM instance configured as your self-managed worker. Follow the AWS [Attach an IAM role to an instance](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/attach-iam-role.html) to learn more.
|
||||
|
||||
1. Continue to the next step to set up the dynamic host catalog. You must add a worker tag when setting up the host catalog to route traffic through the worker that is assuming the role.
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
Complete the following steps to create a dynamic host catalog for AWS:
|
||||
|
||||
<Tabs>
|
||||
<Tab heading="UI" group="ui">
|
||||
|
||||
1. Log in to Boundary.
|
||||
1. Select the org, and then select the project you want to create a host catalog for.
|
||||
1. Select **Host Catalogs**.
|
||||
1. Select **New Host Catalog**.
|
||||
1. 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.
|
||||
- **Type**: (Required) Select **Dynamic** to create a dynamic host catalog.
|
||||
- **Provider**: (Required) Select **AWS** to create a dynamic host catalog for your AWS resources.
|
||||
- **AWS Region**: (Required) Enter the AWS region of the hosts you want to add to the host catalog.
|
||||
- **Credential type**: (Required) Select the type of credential you want to use to authenticate to the host catalog. The required fields for configuring the host catalog vary depending on whether you configure static or dynamic credentials:
|
||||
- **Use an access key (Static Credentials)**: Authenticates to the host catalog using an access key that you generate in AWS.
|
||||
- **Use Assume Role (Dynamic Credentials)**: Authenticates to the host catalog using credentials that AWS `AssumeRole` generates.
|
||||
|
||||
<Tabs>
|
||||
<Tab heading="Static credentials" group="static">
|
||||
|
||||
- **Access Key ID**: (Required) The access key ID for the IAM user to use with this host catalog.
|
||||
- **Secret Access Key**: (Required) The secret access key for the IAM user to use with this host catalog.
|
||||
- **Worker Filter**: (Optional) An optional filter to route requests to a designated worker.
|
||||
|
||||
</Tab>
|
||||
<Tab heading="Dynamic credentials" group="dynamic">
|
||||
|
||||
- **Role ARN**: (Required) - The AWS role ARN to use for `AssumeRole` authentication.
|
||||
If you provide a `role_arn` value, you must also set `disable_credential_rotation` to `true`.
|
||||
- **Role external ID**: (Optional) - The external ID for the `AssumeRole` provider.
|
||||
- **Role session name**: (Optional) - The session name for the `AssumeRole` provider.
|
||||
- **Role tags**: (Optional) - The key-value pair tags for the `AssumeRole` provider.
|
||||
- **Worker Filter**: (Optional) - An optional filter to route requests to a designated worker. The filter should match the worker assigned the IAM role.
|
||||
- **Disable credential rotation**: - When enabled, Boundary does not rotate the credentials with AWS automatically.
|
||||
Credential rotation is automatically disabled when you use dynamic credentials.
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
1. Select **Save**.
|
||||
|
||||
</Tab>
|
||||
<Tab heading="CLI" group="cli">
|
||||
|
||||
The required fields for creating a dynamic host catalog depend on whether you configure static or dynamic credentials.
|
||||
|
||||
<Tabs>
|
||||
<Tab heading="Static credentials" group="static">
|
||||
|
||||
1. Log in to Boundary.
|
||||
1. Use the following command to create a dynamic host catalog for AWS using static credentials:
|
||||
|
||||
```shell-session
|
||||
$ boundary host-catalogs create plugin \
|
||||
-scope-id $BOUNDARY_PROJECT_ID \
|
||||
-plugin-name aws \
|
||||
-attr disable_credential_rotation=true \
|
||||
-attr region=us-east-1 \
|
||||
-secret access_key_id=env://AWS_ACCESS_KEY_ID \
|
||||
-secret secret_access_key=env://AWS_SECRET_ACCESS_KEY
|
||||
```
|
||||
|
||||
The `scope-id` and `plugin-name` fields are required when you create a
|
||||
dynamic host catalog.
|
||||
|
||||
The fields following the `attr` and `secret` flags are specific to AWS and are required by
|
||||
Boundary for authentication.
|
||||
Replace the values in the command with the following required AWS secrets and any attributes you want to associate with the host catalog:
|
||||
|
||||
- `disable_credential_rotation`: When set to `true`, Boundary does not rotate the credentials with AWS automatically.
|
||||
- `region`: The region to configure the host catalog for. All host sets in this catalog are configured for this region.
|
||||
- `access_key_id`: The access key ID for the IAM user to use with this host catalog.
|
||||
- `secret_access_key`: The secret access key for the IAM user to use with this host catalog.
|
||||
|
||||
Refer to the [host catalogs](/boundary/docs/domain-model/host-catalogs) domain model documentation for additional fields that you can use when you create host catalogs.
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab heading="Dynamic credentials" group="dynamic">
|
||||
|
||||
1. Log in to Boundary.
|
||||
1. Use the following command to create a dynamic host catalog using dynamic credentials:
|
||||
|
||||
```shell-session
|
||||
$ boundary host-catalogs create plugin \
|
||||
-scope-id $BOUNDARY_PROJECT_ID \
|
||||
-plugin-name aws \
|
||||
-attr disable_credential_rotation=true \
|
||||
-attr region=us-east-1 \
|
||||
-attr role_arn=AWS_ROLE_ARN_VALUE \
|
||||
-attr role_external_id=AWS_ROLE_EXTERNAL_ID_VALUE \
|
||||
-attr role_session_name=AWS_ROLE_SESSION_NAME_VALUE \
|
||||
-attr role_tags=AWS_ROLE_TAGS_VALUE \
|
||||
-worker-filter '"aws" in "/tags/type"'
|
||||
```
|
||||
|
||||
The `scope-id` and `plugin-name` fields are required when you create a dynamic host catalog.
|
||||
|
||||
Replace the values in the command with the following required AWS secrets and any attributes you want to associate with the host catalog:
|
||||
|
||||
- `disable_credential_rotation`: When set to `true`, Boundary does not rotate the credentials with AWS automatically.
|
||||
You must disable credential rotation to use dynamic credentials.
|
||||
- `region`: The region to configure the host catalog for. All host sets in this catalog will be configured for this region.
|
||||
- `role_arn`: The AWS role ARN used for `AssumeRole` authentication. If you provide a `role_arn` value, you must also set `disable_credential_rotation` to `true`.
|
||||
- `role_external_id`: The external ID that you configured for the `AssumeRole` provider.
|
||||
- `role_session_name`: The session name that you configured for the `AssumeRole` provider.
|
||||
- `role_tags`: The key-value pair tags that you configured for the `AssumeRole` provider.
|
||||
- `worker-filter` A boolean expression to filter which workers can handle dynamic host catalog commands for this host catalog. This should match a valid filter expression for the self-managed worker deployed in AWS. Refer to worker [Filter examples](/boundary/docs/workers/worker-tags#filter-workers-using-tags) to learn more.
|
||||
|
||||
Refer to the [host catalogs](/boundary/docs/domain-model/host-catalogs) domain model documentation for additional fields that you can use when you create host catalogs.
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab heading="Terraform" group="terraform">
|
||||
|
||||
The required fields for creating a dynamic host catalog depend on whether you configure static or dynamic credentials.
|
||||
|
||||
Refer to the [Boundary Terraform provider documentation](https://registry.terraform.io/providers/hashicorp/boundary/latest/docs) to learn about the requirements for the following example attributes.
|
||||
|
||||
<Tabs>
|
||||
<Tab heading="Static credentials" group="static">
|
||||
|
||||
Apply the following Terraform policy:
|
||||
|
||||
```hcl
|
||||
resource "boundary_host_catalog_plugin" "aws_host_catalog" {
|
||||
name = "AWS Catalog"
|
||||
description = "AWS Host Catalog"
|
||||
scope_id = boundary_scope.project.id
|
||||
plugin_name = "aws"
|
||||
|
||||
# recommended to pass in aws secrets using a file() or using environment variables
|
||||
attributes_json = jsonencode({
|
||||
"region" = "eu-west-2",
|
||||
"disable_credential_rotation" = true })
|
||||
secrets_json = jsonencode({
|
||||
"access_key_id" = "AWS_ACCESS_KEY_ID_VALUE",
|
||||
"secret_access_key" = "AWS_SECRET_ACCESS_KEY_VALUE"})
|
||||
}
|
||||
```
|
||||
|
||||
The `scope_id` and `plugin_name` fields are required when you create a dynamic host catalog.
|
||||
|
||||
Replace the values in the configuration with the following required AWS secrets and any attributes you want to associate with the host catalog:
|
||||
|
||||
- `disable_credential_rotation`: When set to `true`, Boundary does not rotate the credentials with AWS automatically.
|
||||
- `region`: The region to configure the host catalog for. All host sets in this catalog are configured for this region.
|
||||
- `access_key_id`: The access key ID for the IAM user to use with this host catalog.
|
||||
- `secret_access_key`: The secret access key for the IAM user to use with this host catalog.
|
||||
|
||||
Refer to the [host catalogs](/boundary/docs/domain-model/host-catalogs) domain model documentation for additional fields that you can use when you create host catalogs.
|
||||
|
||||
</Tab>
|
||||
<Tab heading="Dynamic credentials" group="dynamic">
|
||||
|
||||
Apply the following Terraform policy:
|
||||
|
||||
```hcl
|
||||
resource "boundary_host_catalog_plugin" "aws_host_catalog" {
|
||||
name = "AWS Catalog"
|
||||
description = "AWS Host Catalog"
|
||||
scope_id = boundary_scope.project.id
|
||||
plugin_name = "aws"
|
||||
worker_filter = "\"aws\" in \"/tags/type\""
|
||||
|
||||
attributes_json = jsonencode({
|
||||
"region" = "eu-west-2",
|
||||
"disable_credential_rotation" = true,
|
||||
"role_arn" = "AWS_ROLE_ARN_VALUE",
|
||||
"role_external_id" = "AWS_ROLE_EXTERNAL_ID_VALUE",
|
||||
"role_session_name" = "AWS_ROLE_SESSION_NAME_VALUE",
|
||||
"role_tags" = "AWS_ROLE_TAGS_VALUE"
|
||||
})
|
||||
}
|
||||
```
|
||||
|
||||
The `scope_id` and `plugin_name` fields are required when you create a dynamic host catalog.
|
||||
|
||||
Replace the values in the configuration with the following required AWS secrets and any attributes you want to associate with the host catalog:
|
||||
|
||||
- `worker_filter`: A boolean expression to filter which workers can handle dynamic host catalog commands for this host catalog. This should match a valid filter expression for the self-managed worker deployed in AWS. Refer to worker [Filter examples](/boundary/docs/workers/worker-tags#filter-workers-using-tags) to learn more.
|
||||
- `disable_credential_rotation`: When set to `true`, Boundary does not rotate the credentials with AWS automatically.
|
||||
You must disable credential rotation to use dynamic credentials.
|
||||
- `region`: The region to configure the host catalog for. All host sets in this catalog are configured for this region.
|
||||
- `role_arn`: The AWS role ARN used for `AssumeRole` authentication. If you provide a `role_arn` value, you must also set `disable_credential_rotation` to `true`.
|
||||
- `role_external_id`: The external ID that you configured for the `AssumeRole` provider.
|
||||
- `role_session_name`: The session name that you configured for the `AssumeRole` provider.
|
||||
- `role_tags`: The key-value pair tags that you configured for the `AssumeRole` provider.
|
||||
|
||||
Refer to the [host catalogs](/boundary/docs/domain-model/host-catalogs) domain model documentation for additional fields that you can use when you create host catalogs.
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Create a host set to connect with AWS
|
||||
|
||||
[Host sets](/boundary/docs/domain-model/host-sets) specify which AWS filters should be used to identify the discovered hosts that should be added as members.
|
||||
|
||||
Complete the following steps to create a host set:
|
||||
|
||||
<Tabs>
|
||||
<Tab heading="UI" group="ui">
|
||||
|
||||
1. Log in to Boundary.
|
||||
1. Select the org, and then select the project you want to create a host set for.
|
||||
1. Select **Host Catalogs**.
|
||||
1. Select the dynamic host catalog to which you want add a host set.
|
||||
1. Click the **Host Sets** tab, and then click **New**.
|
||||
1. 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.
|
||||
1. Click **Save**.
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab heading="CLI" group="cli">
|
||||
|
||||
1. Log in to Boundary.
|
||||
1. Use the following command to create a host set:
|
||||
|
||||
```shell-session
|
||||
$ boundary host-sets create plugin \
|
||||
-host-catalog-id $BOUNDARY_HOST_CATALOG_ID \
|
||||
-attr filters=tag-key=foo,bar \
|
||||
-attr filters=tag-key=baz
|
||||
```
|
||||
|
||||
The `host-catalog-id` value is a required field that specifies in which host catalog to create this host set.
|
||||
|
||||
Like with the host catalog, the fields passed in after the `attr` flag are specific to AWS.
|
||||
|
||||
The `filters` field contains string filters in the format key=val1,val2. The key corresponds to a filter option, and the value(s) are a comma-separated list.
|
||||
For a list of filter options, refer to the [describe-instances in the AWS CLI reference](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html).
|
||||
|
||||
When the values in a single `filters` field are separated by a comma, either can be true for the host to match.
|
||||
When multiple filters fields are provided, they must all match for a host to match.
|
||||
In the example above, an instance must have either tags `foo` or `bar`, and must have the tag `baz`.
|
||||
|
||||
Refer to the [host catalogs](/boundary/docs/domain-model/host-catalogs) domain model documentation for additional fields that you can use when you create host catalogs.
|
||||
|
||||
</Tab>
|
||||
<Tab heading="Terraform" group="terraform">
|
||||
|
||||
Apply the following Terraform policy:
|
||||
|
||||
```hcl
|
||||
resource "boundary_host_set_plugin" "aws_host_set" {
|
||||
name = "AWS Host Set"
|
||||
description = "AWS Host Set"
|
||||
host_catalog_id = boundary_host_catalog_plugin.aws_host_catalog.id
|
||||
attributes_json = jsonencode({
|
||||
"filters" = ["tag-key=foo,bar", "tag-key=baz"] })
|
||||
}
|
||||
```
|
||||
|
||||
The `host_catalog_id` value is a required field that specifies in which host catalog to create this host set.
|
||||
|
||||
The `filters` field contains string filters in the format key=val1,val2.
|
||||
The key corresponds to a filter option, and the value(s) are a comma-separated list.
|
||||
For a list of filter options, refer to the [describe-instances in the AWS CLI reference](https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html).
|
||||
|
||||
When the values in a single `filters` field are separated by a comma, either can be true for the host to match.
|
||||
When multiple filters fields are provided, they must all match for a host to match.
|
||||
In the example above, an instance must have either tags `foo` or `bar`, and must have the tag `baz`.
|
||||
|
||||
Refer to the [host catalogs](/boundary/docs/domain-model/host-catalogs) domain model documentation for additional fields that you can use when you create host catalogs.
|
||||
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## More information
|
||||
|
||||
Refer to [Filtering and listing resources](/boundary/docs/filtering) for more information about Boundary's filter syntax and best practices.
|
||||
@@ -0,0 +1,200 @@
|
||||
---
|
||||
layout: docs
|
||||
page_title: Azure dynamic host catalogs
|
||||
description: >-
|
||||
Use dynamic host catalogs to automatically discover Azure resources and add them as hosts. Create a host catalog and host set for Azure resources.
|
||||
---
|
||||
# Azure dynamic host catalogs
|
||||
Boundary uses dynamic host catalogs to automatically discover Azure resources available through Azure Resource Manager (ARM) and add them as hosts.
|
||||
|
||||
The Azure plugin supports Azure Virtual Machines and Azure Virtual Machine Scale Sets in both Flexible and Uniform orchestration modes.
|
||||
It automatically discovers any individual virtual machines included in the scale sets and adds them as hosts.
|
||||
|
||||
## Create a host catalog to connect with Azure
|
||||
Boundary uses plugins to integrate with a variety of providers. To use a
|
||||
dynamic host catalog to integrate with Azure, you create a host catalog of the
|
||||
`plugin` type and set the `plugin-name` value to `azure`. You must also provide the
|
||||
specific fields needed for Boundary to authenticate with Azure.
|
||||
|
||||
Complete the following steps to create a dynamic host catalog for Azure:
|
||||
|
||||
<Tabs>
|
||||
<Tab heading="UI" group="ui">
|
||||
|
||||
1. Log in to Boundary.
|
||||
1. Select the org, and then select the project you want to create a host catalog for.
|
||||
1. Select **Host Catalogs**.
|
||||
1. Select **New Host Catalog**.
|
||||
1. 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.
|
||||
- **Type**: (Required) Select **Dynamic** to create a dynamic host catalog.
|
||||
- **Provider**: (Required) Select **Azure** to create a dynamic host catalog for your Azure resources.
|
||||
- **Tenant/Directory ID**: (Required) The ARM tenant (directory) ID for your Azure Active Directory application.
|
||||
- **Subscription ID**: (Required) The ARM subscription ID for the subscription that has read access.
|
||||
- **Client/Application ID**: (Required) The client (application) ID of the Azure service principal that Boundary should use to authenticate and discover hosts.
|
||||
- **Client Secret Value**: (Required) The ARM client secret value that Azure generates for authentication.
|
||||
- **Disable credential rotation**: When enabled, Boundary does not rotate the credentials with Azure automatically.
|
||||
Azure host catalogs do not currently support credential rotation.
|
||||
1. Select **Save**.
|
||||
|
||||
</Tab>
|
||||
<Tab heading="CLI" group="cli">
|
||||
|
||||
1. Log in to Boundary.
|
||||
1. Use the following command to create a dynamic host catalog for Azure:
|
||||
|
||||
```shell-session
|
||||
$ boundary host-catalogs create plugin \
|
||||
-scope-id $PROJECT_ID \
|
||||
-plugin-name azure \
|
||||
-attr disable_credential_rotation=true \
|
||||
-attr tenant_id=env://ARM_TENANT_ID \
|
||||
-attr subscription_id=env://ARM_SUBSCRIPTION_ID \
|
||||
-attr client_id=env://ARM_CLIENT_ID \
|
||||
-secret secret_value=env://ARM_CLIENT_SECRET
|
||||
```
|
||||
|
||||
The `scope-id` and `plugin-name` fields are required when you create a dynamic host catalog.
|
||||
|
||||
The fields following the `attr` and `secret` flags are specific to Azure and are required by Boundary for authentication.
|
||||
|
||||
- `disable_credential_rotation`: When set to `true`, Boundary does not rotate the credentials automatically.
|
||||
Azure host catalogs do not currently support credential rotation.
|
||||
- `tenant_id`: (Required) The ARM tenant (directory) ID for your Azure Active Directory application.
|
||||
- `subscription_id`: (Required) The ARM subscription ID for the subscription that has read access.
|
||||
- `client_id`: (Required) The client (application) ID of the Azure service principal that Boundary should use to authenticate and discover hosts.
|
||||
- `secret_value`: (Required) The ARM client secret value that Azure generates for authentication.
|
||||
|
||||
Refer to the [host catalogs](/boundary/docs/domain-model/host-catalogs) domain model documentation for additional fields that you can use when you create host catalogs.
|
||||
|
||||
</Tab>
|
||||
<Tab heading="Terraform" group="terraform">
|
||||
|
||||
Refer to the [Boundary Terraform provider documentation](https://registry.terraform.io/providers/hashicorp/boundary/latest/docs) to learn about the requirements for the following example attributes.
|
||||
|
||||
Apply the following Terraform policy:
|
||||
|
||||
```hcl
|
||||
resource "boundary_host_catalog_plugin" "azure_host_catalog" {
|
||||
name = "Azure Catalog"
|
||||
description = "Azure Host Catalog"
|
||||
scope_id = boundary_scope.project.id
|
||||
plugin_name = "azure"
|
||||
|
||||
# recommended to pass in aws secrets using a file() or using environment variables
|
||||
attributes_json = jsonencode({
|
||||
"tenant_id" = "ARM_TENANT_ID",
|
||||
"subscription_id" = "ARM_SUBSCRIPTION_ID"
|
||||
"client_id" = "ARM_CLIENT_ID"
|
||||
"disable_credential_rotation" = true })
|
||||
secrets_json = jsonencode({
|
||||
"secret_value" = "ARM_CLIENT_SECRET"})
|
||||
}
|
||||
```
|
||||
|
||||
The `scope_id` and `plugin_name` fields are required when you create a
|
||||
dynamic host catalog.
|
||||
|
||||
The fields following the `attributes_json` and `secrets_json` flags are specific to Azure and are required by
|
||||
Boundary for authentication.
|
||||
|
||||
- `disable_credential_rotation`: When set to `true`, Boundary does not rotate the credentials automatically.
|
||||
Azure host catalogs do not currently support credential rotation.
|
||||
- `tenant_id`: (Required) The ARM tenant (directory) ID for your Azure Active Directory application.
|
||||
- `subscription_id`: (Required) The ARM subscription ID for the subscription that has read access.
|
||||
- `client_id`: (Required) The client (application) ID of the Azure service principal that Boundary should use to authenticate and discover hosts.
|
||||
- `secret_value`: (Required) The ARM client secret value that Azure generates for authentication.
|
||||
|
||||
Refer to the [host catalogs](/boundary/docs/domain-model/host-catalogs) domain model documentation for additional fields that you can use when you create host catalogs.
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Create a host set to connect with Azure
|
||||
[Host sets](/boundary/docs/domain-model/host-sets) specify which Azure
|
||||
Resource Manager (ARM) filters should be used to identify the discovered hosts that should be added as members.
|
||||
|
||||
Complete the following steps to create a host set:
|
||||
|
||||
<Tabs>
|
||||
<Tab heading="UI" group="ui">
|
||||
|
||||
1. Log in to Boundary.
|
||||
1. Select the org, and then select the project you want to create a host set for.
|
||||
1. Select **Host Catalogs**.
|
||||
1. Select the dynamic host catalog to which you want add a host set.
|
||||
1. Click the **Host Sets** tab, and then click **New**.
|
||||
1. 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.
|
||||
1. Click **Save**.
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab heading="CLI" group="cli">
|
||||
|
||||
1. Log in to Boundary.
|
||||
1. Use the following command to create a host set:
|
||||
|
||||
```shell-session
|
||||
$ boundary host-sets create plugin \
|
||||
-name database \
|
||||
-host-catalog-id $HOST_CATALOG_ID \
|
||||
-attr filter="tagName eq 'service-type' and tagValue eq 'database'"
|
||||
```
|
||||
|
||||
The `host-catalog-id` value is a required field that specifies in which host catalog to create this host set.
|
||||
|
||||
The fields following the `attr` flag are specific to Azure.
|
||||
|
||||
The `filter` field represents the ARM filter used to select resources that should be a part of this host set.
|
||||
There are some limitations with the filtering syntax.
|
||||
Specifically, when you use tags, other types of filters (such as on resource type) are not allowed.
|
||||
As a result, it is generally useful to filter directly on tag names or values as in the following examples:
|
||||
- `tagName eq 'application'`
|
||||
- `tagName eq 'application' and tagValue eq 'app2'`
|
||||
|
||||
Refer to the [host catalogs](/boundary/docs/domain-model/host-catalogs) domain model documentation for additional fields that you can use when you create host catalogs.
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab heading="Terraform" group="terraform">
|
||||
|
||||
Refer to the [Boundary Terraform provider documentation](https://registry.terraform.io/providers/hashicorp/boundary/latest/docs) to learn about the requirements for the following example attributes.
|
||||
|
||||
Apply the following Terraform policy:
|
||||
|
||||
```hcl
|
||||
resource "boundary_host_set_plugin" "azure_host_set" {
|
||||
name = "Azure Set"
|
||||
description = "Azure Host Set"
|
||||
host_catalog_id = boundary_scope.azure_host_catalog.id
|
||||
attributes_json = jsonencode({
|
||||
"filter" = "tagName eq 'service-type' and tagValue eq 'database'" })
|
||||
}
|
||||
```
|
||||
|
||||
The `host_catalog_id` value is a required field that specifies in which host catalog to
|
||||
create this host set.
|
||||
|
||||
The fields following the `attributes_json` flag are specific to Azure.
|
||||
|
||||
The `filter` field represents the ARM filter used to select resources that should be a part of
|
||||
this host set. There are some limitations with the filtering syntax.
|
||||
Specifically, when you use tags, other types of filters (such as on resource
|
||||
type) are not allowed. As a result, it is generally useful to filter
|
||||
directly on tag names or values as in the following examples:
|
||||
- `tagName eq 'application'`
|
||||
- `tagName eq 'application' and tagValue eq 'app2'`
|
||||
|
||||
Refer to the [host catalogs](/boundary/docs/domain-model/host-catalogs) domain model documentation for additional fields that you can use when you create host catalogs.
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## More information
|
||||
|
||||
Refer to [Filtering and listing resources](/boundary/docs/filtering) for more information about Boundary's filter syntax and best practices.
|
||||
@@ -0,0 +1,498 @@
|
||||
---
|
||||
layout: docs
|
||||
page_title: GCP dynamic host catalogs
|
||||
description: >-
|
||||
Use dynamic host catalogs to automatically discover GCP Compute Engine VM instances and add them as hosts. Create a host catalog and host set for GCP resources.
|
||||
---
|
||||
# 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):
|
||||
|
||||
<Tabs>
|
||||
<Tab heading="Service account" group="account">
|
||||
|
||||
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 if `disable_credential_rotation` is set to `false`.
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab heading="Service impersonation" group="impersonation">
|
||||
|
||||
Service account impersonation allows Boundary to authenticate with GCP using a service account that impersonates another service account.
|
||||
Impersonation is useful when you want to restrict the permissions of the service account Boundary uses.
|
||||
|
||||
You must create two service accounts to authenticate using service impersonation:
|
||||
|
||||
- `Base service account`: The service account Boundary uses to authenticate with GCP. The service account should have the following roles:
|
||||
- `roles/iam.serviceAccountTokenCreator`: (Required) To create a token for the target service account.
|
||||
- `roles/iam.serviceAccountKeyAdmin`: (Optional) To rotate the service account key if `disable_credential_rotation` is set to `false`.
|
||||
|
||||
- `Target service account`: The service account to impersonate. The service account should have the following role:
|
||||
- `roles/compute.viewer`: (Required) To list Compute Engine VM instance in the project.
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab heading="Application Default Credential (ADC)" group="ADC">
|
||||
|
||||
If you run Boundary on a GCP VM instance, you can use Application Default Credentials (ADC) to authenticate with GCP.
|
||||
Boundary uses the service account associated with the VM instance to authenticate with GCP.
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
<Note>
|
||||
|
||||
If you downloaded the private key from GCP, it may contain extra `/n` characters that cause an error.
|
||||
You can use the `jq` utility to remove the extra `/n` characters. For example:
|
||||
|
||||
```shell-session
|
||||
$ jq -r '.private_key' my-gcp-private-key.json
|
||||
```
|
||||
|
||||
</Note>
|
||||
|
||||
## 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:
|
||||
|
||||
<Tabs>
|
||||
<Tab heading="UI" group="ui">
|
||||
|
||||
1. Log in to Boundary.
|
||||
1. Select the org, and then select the project you want to create a host catalog for.
|
||||
1. Select **Host Catalogs**.
|
||||
1. Select **New Host Catalog**.
|
||||
1. 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.
|
||||
|
||||
The required fields for creating a dynamic host catalog depend on the type of authentication you configure.
|
||||
|
||||
<Tabs>
|
||||
<Tab heading="Service account" group="account">
|
||||
|
||||
- **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 use `jq` to remove the extra `/n` characters.
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab heading="Service impersonation" group="impersonation">
|
||||
|
||||
- **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 base service account.
|
||||
It is required when you authenticate using service account impersonation.
|
||||
- **Target Service Account ID**: The unique identifier for the service account that is impersonated.
|
||||
It is required when you authenticate using service account impersonation.
|
||||
- **Private Key ID**: The unique identifier of the private key for the base service account.
|
||||
It is required when you authenticate using service account impersonation.
|
||||
- **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 service account impersonation.
|
||||
|
||||
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.
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab heading="Application Default Credential (ADC)" group="ADC">
|
||||
|
||||
- **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**: (Optional) The unique email address that is used to identify the base service account.
|
||||
- **Target Service Account ID**: Skip this field when you configure authentication using the ADC.
|
||||
It is only used when you authenticate using service account impersonation.
|
||||
- **Private Key ID**: (Optional) The unique identifier of the private key for the base service account.
|
||||
- **Private Key**: (Optional) The private key used to obtain an OAuth 2.0 access token.
|
||||
The key must be PEM encoded.
|
||||
|
||||
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.
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
- **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.
|
||||
1. Select **Save**.
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab heading="CLI" group="cli">
|
||||
|
||||
The required fields for creating a dynamic host catalog depend on the type of authentication you configure.
|
||||
|
||||
<Tabs>
|
||||
<Tab heading="Service account" group="account">
|
||||
|
||||
1. Log in to Boundary.
|
||||
1. Use the following command to create a dynamic host catalog for GCP:
|
||||
|
||||
```shell-session
|
||||
$ boundary host-catalogs create plugin \
|
||||
-scope-id $BOUNDARY_PROJECT_ID \
|
||||
-plugin-name gcp \
|
||||
-attr disable_credential_rotation=true \
|
||||
-attr zone=us-central1-a \
|
||||
-attr project_id=env://GCP_PROJECT_ID \
|
||||
-attr client_email=env://CLIENT_EMAIL \
|
||||
-secret private_key_id=env://PRIVATE_KEY_ID \
|
||||
-secret private_key=file://$PRIVATE_KEY_FILE_PATH
|
||||
```
|
||||
|
||||
The `scope-id` and `plugin-name` fields are required when you create a dynamic host catalog.
|
||||
|
||||
The fields following the `attr` and `secret` flags are specific to GCP and are used by Boundary for authentication:
|
||||
|
||||
- `disable_credential_rotation`: (Optional) When set to `true`, Boundary does not rotate the credentials automatically.
|
||||
- `zone`: (Required) The GCP zone of the instances that you want to add to the host catalog.
|
||||
- `project_id`: (Required) The project ID of any 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.
|
||||
- `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 use `jq` to remove the extra `/n` characters.
|
||||
|
||||
Refer to the [host catalogs](/boundary/docs/domain-model/host-catalogs) domain model documentation for additional fields that you can use when you create host catalogs.
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab heading="Service impersonation" group="impersonation">
|
||||
|
||||
1. Log in to Boundary.
|
||||
1. Use the following command to create a dynamic host catalog for GCP:
|
||||
|
||||
```shell-session
|
||||
$ boundary host-catalogs create plugin \
|
||||
-scope-id $BOUNDARY_PROJECT_ID \
|
||||
-plugin-name gcp \
|
||||
-attr disable_credential_rotation=true \
|
||||
-attr zone=us-central1-a \
|
||||
-attr project_id=env://GCP_PROJECT_ID \
|
||||
-attr client_email=env://BASE_SERVICE_ACCOUNT_EMAIL \
|
||||
-attr target_service_account_id=env://TARGET_SERVICE_ACCOUNT_EMAIL \
|
||||
-secret private_key_id=env://BASE_SERVICE_ACCOUNT_PRIVATE_KEY_ID \
|
||||
-secret private_key=file://$BASE_SERVICE_ACCOUNT_PRIVATE_KEY_FILE_PATH
|
||||
```
|
||||
|
||||
The `scope-id` and `plugin-name` fields are required when you create a dynamic host catalog.
|
||||
|
||||
The fields following the `attr` and `secret` flags are specific to GCP and are required by Boundary for authentication:
|
||||
|
||||
- `disable_credential_rotation`: (Optional) When set to `true`, Boundary does not rotate the credentials with GCP automatically.
|
||||
- `zone`: (Required) The deployment area within a region.
|
||||
All host sets in this catalog are configured for this zone.
|
||||
- `project_id`: (Required) The project ID associated with the service account.
|
||||
- `client_email`: The email address used to uniquely identify the base service account.
|
||||
It is required when you authenticate using service account impersonation.
|
||||
- `target_service_account_id`: The email address of the service account to impersonate.
|
||||
It is required when you authenticate using service account impersonation.
|
||||
- `private_key_id`: The ID of the private key for the base service account to use with this host catalog.
|
||||
It is required when you authenticate using service account impersonation.
|
||||
- `private_key`: The private key for the base service account to use with this host catalog.
|
||||
It is required when you authenticate using service account impersonation.
|
||||
|
||||
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.
|
||||
|
||||
Refer to the [host catalogs](/boundary/docs/domain-model/host-catalogs) domain model documentation for additional fields that you can use when you create host catalogs.
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab heading="Application Default Credential (ADC)" group="ADC">
|
||||
|
||||
1. Log in to Boundary.
|
||||
1. Use the following command to create a dynamic host catalog for GCP:
|
||||
|
||||
```shell-session
|
||||
$ boundary host-catalogs create plugin \
|
||||
-scope-id $BOUNDARY_PROJECT_ID \
|
||||
-plugin-name gcp \
|
||||
-attr disable_credential_rotation=true \
|
||||
-attr zone=us-central1-a \
|
||||
-attr project_id=env://GCP_PROJECT_ID
|
||||
```
|
||||
|
||||
The `scope-id` and `plugin-name` fields are required when you create a dynamic host catalog.
|
||||
|
||||
The fields following the `attr` flag are specific to GCP and are required by Boundary for authentication:
|
||||
|
||||
- `disable_credential_rotation`: (Optional) When set to `true`, Boundary does not rotate the credentials with GCP automatically.
|
||||
- `zone`: (Required) The deployment area within a region.
|
||||
All host sets in this catalog are configured for this zone.
|
||||
- `project_id`: (Required) The project ID associated with the service account.
|
||||
|
||||
Refer to the [host catalogs](/boundary/docs/domain-model/host-catalogs) domain model documentation for additional fields that you can use when you create host catalogs.
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab heading="Terraform" group="terraform">
|
||||
|
||||
The required fields for creating a dynamic host catalog depend on the type of authentication you configure.
|
||||
|
||||
<Tabs>
|
||||
<Tab heading="Service account" group="account">
|
||||
|
||||
Refer to the [Boundary Terraform provider documentation](https://registry.terraform.io/providers/hashicorp/boundary/latest/docs) to learn about the requirements for the following example attributes.
|
||||
|
||||
Apply the following Terraform policy:
|
||||
|
||||
```hcl
|
||||
resource "boundary_host_catalog_plugin" "gcp_host_catalog" {
|
||||
name = "GCP Catalog"
|
||||
description = "GCP Host Catalog"
|
||||
scope_id = boundary_scope.project.id
|
||||
plugin_name = "gcp"
|
||||
|
||||
# recommended to pass in aws secrets using a file() or using environment variables
|
||||
attributes_json = jsonencode({
|
||||
"zone" = "us-central1-a ",
|
||||
"project_id" = "GCP_PROJECT_ID_VALUE",
|
||||
"client_email" = "GCP_CLIENT_EMAIL_VALUE",
|
||||
"disable_credential_rotation" = true })
|
||||
secrets_json = jsonencode({
|
||||
"private_key_id" = "GCP_PRIVATE_KEY_ID_VALUE",
|
||||
"private_key" = "GCP_PRIVATE_KEY_VALUE"})
|
||||
}
|
||||
```
|
||||
|
||||
The `scope_id` and `plugin_name` fields are required when you create a dynamic host catalog.
|
||||
|
||||
The fields following `attributes_json` and `secrets_json` are specific to GCP and are used by Boundary for authentication:
|
||||
|
||||
- `zone`: (Required) The GCP zone of the instances that you want to add to the host catalog.
|
||||
- `project_id`: (Required) The project ID of any 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.
|
||||
- `disable_credential_rotation`: (Optional) When set to `true`, Boundary does not rotate the credentials automatically.
|
||||
- `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 use `jq` to remove the extra `/n` characters.
|
||||
|
||||
Refer to the [host catalogs](/boundary/docs/domain-model/host-catalogs) domain model documentation for additional fields that you can use when you create host catalogs.
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab heading="Service impersonation" group="impersonation">
|
||||
|
||||
Refer to the [Boundary Terraform provider documentation](https://registry.terraform.io/providers/hashicorp/boundary/latest/docs) to learn about the requirements for the following example attributes.
|
||||
|
||||
Apply the following Terraform policy:
|
||||
|
||||
```hcl
|
||||
resource "boundary_host_catalog_plugin" "gcp_host_catalog" {
|
||||
name = "GCP Catalog"
|
||||
description = "GCP Host Catalog"
|
||||
scope_id = boundary_scope.project.id
|
||||
plugin_name = "gcp"
|
||||
|
||||
# recommended to pass in aws secrets using a file() or using environment variables
|
||||
attributes_json = jsonencode({
|
||||
"zone" = "us-central1-a ",
|
||||
"project_id" = "GCP_PROJECT_ID_VALUE",
|
||||
"client_email" = "GCP_BASE_SERVICE_ACCOUNT_EMAIL_VALUE",
|
||||
"target_service_account_id" = "GCP_TARGET_SERVICE_ACCOUNT_EMAIL_VALUE",
|
||||
"disable_credential_rotation" = true })
|
||||
secrets_json = jsonencode({
|
||||
"private_key_id" = "BASE_SERVICE_ACCOUNT_PRIVATE_KEY_ID_VALUE",
|
||||
"private_key" = "BASE_SERVICE_ACCOUNT_PRIVATE_KEY_VALUE"})
|
||||
}
|
||||
```
|
||||
|
||||
The `scope_id` and `plugin_name` fields are required when you create a dynamic host catalog.
|
||||
|
||||
The fields following `attributes_json` and `secrets_json` are specific to GCP and are required by Boundary for authentication:
|
||||
|
||||
- `zone`: (Required) The deployment area within a region. All host sets in this
|
||||
catalog are configured for this zone.
|
||||
- `project_id`: (Required) The project ID associated with the service account.
|
||||
- `client_email`: The email address used to uniquely identify the base service account.
|
||||
It is required when you authenticate using service account impersonation.
|
||||
- `target_service_account_id`: The email address of the service account to impersonate.
|
||||
It is required when you authenticate using service account impersonation.
|
||||
- `disable_credential_rotation`: (Optional) When set to `true`, Boundary does not rotate the credentials with GCP automatically.
|
||||
- `private_key_id`: The ID of the private key for the base service account to use with this host catalog.
|
||||
It is required when you authenticate using service account impersonation.
|
||||
- `private_key`: The private key for the base service account to use with this host catalog.
|
||||
It is required when you authenticate using service account impersonation.
|
||||
|
||||
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.
|
||||
|
||||
Refer to the [host catalogs](/boundary/docs/domain-model/host-catalogs) domain model documentation for additional fields that you can use when you create host catalogs.
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab heading="Application Default Credential (ADC)" group="ADC">
|
||||
|
||||
Refer to the [Boundary Terraform provider documentation](https://registry.terraform.io/providers/hashicorp/boundary/latest/docs) to learn about the requirements for the following example attributes.
|
||||
|
||||
Apply the following Terraform policy:
|
||||
|
||||
```hcl
|
||||
resource "boundary_host_catalog_plugin" "gcp_host_catalog" {
|
||||
name = "GCP Catalog"
|
||||
description = "GCP Host Catalog"
|
||||
scope_id = boundary_scope.project.id
|
||||
plugin_name = "gcp"
|
||||
|
||||
# recommended to pass in aws secrets using a file() or using environment variables
|
||||
attributes_json = jsonencode({
|
||||
"zone" = "us-central1-a ",
|
||||
"project_id" = "GCP_PROJECT_ID_VALUE",
|
||||
"disable_credential_rotation" = true })
|
||||
}
|
||||
```
|
||||
|
||||
The `scope_id` and `plugin_name` fields are required when you create a dynamic host catalog.
|
||||
|
||||
The fields following `attributes_json` are specific to GCP and are required by Boundary for authentication:
|
||||
|
||||
- `zone`: (Required) The GCP zone of the instances that you want to add to the host catalog.
|
||||
- `project_id`: (Required) The project ID of any instances that you want to add to the host catalog.
|
||||
- `disable_credential_rotation`: (Optional) When set to `true`, Boundary does not rotate the credentials with GCP automatically.
|
||||
|
||||
Refer to the [host catalogs](/boundary/docs/domain-model/host-catalogs) domain model documentation for additional fields that you can use when you create host catalogs.
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Create a host set to connect with GCP
|
||||
|
||||
[Host sets](/boundary/docs/domain-model/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:
|
||||
|
||||
<Tabs>
|
||||
<Tab heading="UI" group="ui">
|
||||
|
||||
1. Log in to Boundary.
|
||||
1. Select the org, and then select the project you want to create a host set for.
|
||||
1. Select **Host Catalogs**.
|
||||
1. Select the dynamic host catalog to which you want to add a host set.
|
||||
1. Click the **Host Sets** tab, and then click **New**.
|
||||
1. 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.
|
||||
1. Click **Save**.
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab heading="CLI" group="cli">
|
||||
|
||||
1. Log in to Boundary.
|
||||
1. Use the following command to create a host set:
|
||||
|
||||
```shell-session
|
||||
$ boundary host-sets create plugin \
|
||||
-host-catalog-id $BOUNDARY_HOST_CATALOG_ID \
|
||||
-attr filters=labels.env:prod \
|
||||
-attr filters=labels.app:web
|
||||
```
|
||||
|
||||
The `host-catalog-id` value is a required field that specifies in which host catalog to create this host set.
|
||||
|
||||
Like with the host catalog, the fields passed in after the `attr` flag are specific to GCP.
|
||||
|
||||
The `filters` field contains string filters in the format key=val.
|
||||
The key corresponds to a filter option.
|
||||
For a list of filter options, refer to the [GCP API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/instances/list#filter).
|
||||
When you apply multiple filters, the plugin applies a logical `AND` operation to combine the filters.
|
||||
|
||||
If there is no explicit instance status filter, the default status is set to `status="RUNNING"`.
|
||||
The default status ensures that Boundary only filters running instances, saving time when processing results.
|
||||
|
||||
We recommend using labels as filters because they are more flexible and can filter on multiple values as in the following examples:
|
||||
|
||||
- `-attr filters=labels.env:dev`
|
||||
- `-attr filters="labels.env:prod AND labels.app:web"`
|
||||
|
||||
Refer to the [host catalogs](/boundary/docs/domain-model/host-catalogs) domain model documentation for additional fields that you can use when you create host catalogs.
|
||||
|
||||
</Tab>
|
||||
<Tab heading="Terraform" group="terraform">
|
||||
|
||||
Refer to the [Boundary Terraform provider documentation](https://registry.terraform.io/providers/hashicorp/boundary/latest/docs) to learn about the requirements for the following example attributes.
|
||||
|
||||
Apply the following Terraform policy:
|
||||
|
||||
```hcl
|
||||
resource "boundary_host_set_plugin" "gcp_host_set" {
|
||||
name = "GCP Host Set"
|
||||
description = "GCP Host Set"
|
||||
host_catalog_id = boundary_host_catalog_plugin.gcp_host_catalog.id
|
||||
attributes_json = jsonencode({
|
||||
"filters" = ["labels.env:prod", "labels.app:web"] })
|
||||
}
|
||||
```
|
||||
|
||||
The `host_catalog_id` value is a required field that specifies in which host catalog to create this host set.
|
||||
|
||||
Like with the host catalog, the fields passed in after `attributes_json` flag are specific to GCP.
|
||||
|
||||
The `filters` field contains string filters in the format key=val1.
|
||||
The key corresponds to a filter option.
|
||||
For a list of filter options, refer to the [GCP API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/instances/list#filter).
|
||||
When you apply multiple filters, the plugin applies a logical `AND` operation to combine the filters.
|
||||
|
||||
If there is no explicit instance status filter, the default status is set to `status="RUNNING"`.
|
||||
The default status ensures that Boundary only filters running instances, saving time when processing results.
|
||||
|
||||
We recommend using labels as filters because they are more flexible and can filter on multiple values as in the following examples:
|
||||
|
||||
- `-attr filters=labels.env:dev`
|
||||
- `-attr filters="labels.env:prod AND labels.app:web"`
|
||||
|
||||
Refer to the [host catalogs](/boundary/docs/domain-model/host-catalogs) domain model documentation for additional fields that you can use when you create host catalogs.
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## More information
|
||||
|
||||
Refer to [Filtering and listing resources](/boundary/docs/filtering) for more information about Boundary's filter syntax and best practices.
|
||||
@@ -0,0 +1,65 @@
|
||||
---
|
||||
layout: docs
|
||||
page_title: Host discovery
|
||||
description: >-
|
||||
Learn how host discovery workflows let Boundary discover and onboard new resources. Understand how dynamic host catalogs enable automated host discovery.
|
||||
---
|
||||
|
||||
# Host discovery
|
||||
|
||||
Traditionally, connecting to remote hosts and services requires knowledge of
|
||||
the endpoint’s connection info (e.g. the IP address and port of the service).
|
||||
This creates complexity when managing the onboarding of new resources at scale
|
||||
or dealing with dynamic, ephemeral services whose connection info frequently changes.
|
||||
Furthermore, the increased operational overhead of having to manually manage and update
|
||||
new or old resources is an inefficient use of time.
|
||||
Resources should be tagged appropriately so that, depending on their identity, users
|
||||
automatically have the resources that they are allowed to connect to.
|
||||
|
||||
**Host discovery** focuses on automating the process of onboarding new or
|
||||
changed infrastructure resources – and their connection info – to Boundary
|
||||
as hosts.
|
||||
|
||||
## Automated host discovery in Boundary
|
||||
|
||||
Boundary supports target/host discovery in three primary workflows:
|
||||
|
||||
**[Manual configuration](/boundary/tutorials/community-administration/community-manage-targets)**:
|
||||
Boundary administrators can manually configure static
|
||||
hosts and targets via the administrator UI and CLI. Manual configuration of
|
||||
targets with static hosts requires knowledge of the IP address or endpoint used
|
||||
to connect to a host.
|
||||
|
||||
**[Host discovery via configuration as code with Terraform](/boundary/tutorials/get-started-community/community-get-started-config)**:
|
||||
Boundary is fully programmatically instrumented and the discovery and configuration of new
|
||||
infrastructure targets can be automated with
|
||||
[Boundary’s Terraform provider](https://registry.terraform.io/providers/hashicorp/boundary/latest/docs).
|
||||
This allows for dynamic configuration of a host and target without the need
|
||||
for prior knowledge of the target’s connection info.
|
||||
|
||||
**[Runtime host discovery via dynamic host catalogs](/boundary/tutorials/host-management/aws-host-catalogs)**:
|
||||
Boundary dynamic host catalogs automate the ingestion of resources from
|
||||
infrastructure providers into Boundary. Boundary hosts are automatically
|
||||
created, updated and added to host sets in order to reflect the connection
|
||||
information maintained in these providers. This removes the need to know
|
||||
host connection info or reapply infrastructure as code templates to
|
||||
configure new or changed resources.
|
||||
|
||||
## Dynamic host catalogs
|
||||
Dynamic host catalogs are an agentless workflow for Boundary to
|
||||
securely query infrastructure providers at runtime to discover and configure
|
||||
new services. Boundary administrators can define rules for which
|
||||
external resources should be ingested into the catalog by
|
||||
[creating a host set](/boundary/docs/domain-model/host-sets)
|
||||
with an attributes filter. These filters specify which discovered hosts
|
||||
should be members of the host set.
|
||||
|
||||
Boundary currently supports dynamic host catalog for AWS, Azure, and GCP.
|
||||
We will continue to grow this ecosystem to support additional providers.
|
||||
|
||||
## Next steps
|
||||
To get started with dynamic host catalogs, refer to the following topics:
|
||||
|
||||
- [AWS dynamic host catalogs](/boundary/docs/hosts/aws)
|
||||
- [Azure dynamic host catalogs](/boundary/docs/hosts/azure)
|
||||
- [GCP dynamic host catalogs](/boundary/docs/hosts/gcp)
|
||||
Reference in new issue
Block a user