2022-01-19 16:19:09 -08:00
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title : "boundary_host_set_plugin Resource - terraform-provider-boundary"
subcategory : ""
description : |-
2024-10-26 14:48:46 -07:00
The host_set_plugin resource allows you to configure a Boundary host set. Host sets are always part of a host catalog, so a host catalog resource should be used inline or you should have the host catalog ID in hand to successfully configure a host set.
2022-01-19 16:19:09 -08:00
---
# boundary_host_set_plugin (Resource)
The host_set_plugin resource allows you to configure a Boundary host set. Host sets are always part of a host catalog, so a host catalog resource should be used inline or you should have the host catalog ID in hand to successfully configure a host set.
2022-09-21 13:45:56 -07:00
## Example Usage
2022-01-19 16:19:09 -08:00
2022-09-21 13:45:56 -07:00
```terraform
resource "boundary_scope" "org" {
name = "organization_one"
description = "My first scope!"
scope_id = "global"
auto_create_admin_role = true
auto_create_default_role = true
}
resource "boundary_scope" "project" {
name = "project_one"
description = "My first scope!"
scope_id = boundary_scope . org . id
auto_create_admin_role = true
}
# For more information about the aws plugin, please visit here:
# https://github.com/hashicorp/boundary-plugin-host-aws
#
# For more information about aws users, please visit here:
# https://learn.hashicorp.com/tutorials/boundary/aws-host-catalogs?in=boundary/oss-access-management#configure-terraform-and-iam-user-privileges
resource "boundary_host_catalog_plugin" "aws_example" {
name = "My aws catalog"
description = "My first host catalog!"
scope_id = boundary_scope . project . id
plugin_name = "aws"
2022-10-03 18:24:10 -07:00
attributes_json = jsonencode ({ "region" = "us-east-1" })
2022-09-21 13:45:56 -07:00
# recommended to pass in aws secrets using a file() or using environment variables
# the secrets below must be generated in aws by creating a aws iam user with programmatic access
2022-10-03 18:24:10 -07:00
secrets_json = jsonencode ({
"access_key_id" = "aws_access_key_id_value" ,
"secret_access_key" = "aws_secret_access_key_value"
2022-09-21 13:45:56 -07:00
})
}
resource "boundary_host_set_plugin" "web" {
name = "My web host set plugin"
2023-03-11 16:54:24 -06:00
host_catalog_id = boundary_host_catalog_plugin . aws_example . id
2023-06-23 14:21:21 -04:00
attributes_json = jsonencode ({ "filters" = [ "tag:service-type=web" ] })
2022-09-21 13:45:56 -07:00
}
resource "boundary_host_set_plugin" "foobar" {
name = "My foobar host set plugin"
2023-03-11 16:54:24 -06:00
host_catalog_id = boundary_host_catalog_plugin . aws_example . id
2022-09-21 13:45:56 -07:00
preferred_endpoints = [ "cidr:54.0.0.0/8" ]
2022-10-03 18:24:10 -07:00
attributes_json = jsonencode ({
2023-06-23 14:21:21 -04:00
"filters" = [ "tag-key=foo" , "tag-key=bar" ]
2022-09-21 13:45:56 -07:00
})
}
resource "boundary_host_set_plugin" "launch" {
name = "My launch host set plugin"
2023-03-11 16:54:24 -06:00
host_catalog_id = boundary_host_catalog_plugin . aws_example . id
2022-09-21 13:45:56 -07:00
sync_interval_seconds = 60
2022-10-03 18:24:10 -07:00
attributes_json = jsonencode ({
2023-06-23 14:21:21 -04:00
"filters" = [ "tag:development=prod,dev" , "launch-time=2022-01-04T*" ]
2022-09-21 13:45:56 -07:00
})
}
# For more information about the azure plugin, please visit here:
# https://github.com/hashicorp/boundary-plugin-host-azure
#
# For more information about azure ad applications, please visit here:
# https://learn.hashicorp.com/tutorials/boundary/azure-host-catalogs#register-a-new-azure-ad-application-1
resource "boundary_host_catalog_plugin" "azure_example" {
2022-10-03 18:24:10 -07:00
name = "My azure catalog"
description = "My second host catalog!"
scope_id = boundary_scope . project . id
plugin_name = "azure"
2022-09-21 13:45:56 -07:00
# the attributes below must be generated in azure by creating an ad application
attributes_json = jsonencode ({
2022-10-03 18:24:10 -07:00
"disable_credential_rotation" = "true" ,
"tenant_id" = "ARM_TENANT_ID" ,
"subscription_id" = "ARM_SUBSCRIPTION_ID" ,
"client_id" = "ARM_CLIENT_ID"
2022-09-21 13:45:56 -07:00
})
2023-05-10 22:13:22 +02:00
# recommended to pass in azure secrets using a file() or using environment variables
2022-09-21 13:45:56 -07:00
# the secrets below must be generated in azure by creating an ad application
2022-10-03 18:24:10 -07:00
secrets_json = jsonencode ({
"secret_value" = "ARM_CLIENT_SECRET"
2022-09-21 13:45:56 -07:00
})
}
resource "boundary_host_set_plugin" "database" {
name = "My database host set plugin"
2023-03-11 16:54:24 -06:00
host_catalog_id = boundary_host_catalog_plugin . azure_example . id
2022-10-03 18:24:10 -07:00
attributes_json = jsonencode ({ "filter" = "tagName eq 'service-type' and tagValue eq 'database'" })
2022-09-21 13:45:56 -07:00
}
resource "boundary_host_set_plugin" "foodev" {
name = "My foodev host set plugin"
2023-03-11 16:54:24 -06:00
host_catalog_id = boundary_host_catalog_plugin . azure_example . id
2022-09-21 13:45:56 -07:00
preferred_endpoints = [ "cidr:54.0.0.0/8" ]
sync_interval_seconds = 60
2022-10-03 18:24:10 -07:00
attributes_json = jsonencode ({
"filter" = "tagName eq 'tag-key' and tagValue eq 'foo'" ,
"filter" = "tagName eq 'application' and tagValue eq 'dev'" ,
2022-09-21 13:45:56 -07:00
})
}
```
2022-01-19 16:19:09 -08:00
<!-- schema generated by tfplugindocs -->
## Schema
### Required
2022-05-13 18:10:43 -07:00
- `host_catalog_id` (String) The catalog for the host set.
2022-01-19 16:19:09 -08:00
### Optional
2022-05-13 18:10:43 -07:00
- `attributes_json` (String) The attributes for the host set. Either values encoded with the "jsonencode" function, pre-escaped JSON string, or a file:// or env:// path. Set to a string "null" or remove the block to clear all attributes in the host set.
- `description` (String) The host set description.
- `name` (String) The host set name. Defaults to the resource name.
- `preferred_endpoints` (List of String) The ordered list of preferred endpoints.
- `sync_interval_seconds` (Number) The value to set for the sync interval seconds.
- `type` (String) The type of host set
2022-01-19 16:19:09 -08:00
### Read-Only
2022-05-13 18:10:43 -07:00
- `id` (String) The ID of the host set.
2022-01-19 16:19:09 -08:00
2022-09-21 13:45:56 -07:00
## Import
Import is supported using the following syntax:
2022-01-19 16:19:09 -08:00
2025-07-08 13:23:01 -04:00
The [`terraform import` command ](https://developer.hashicorp.com/terraform/cli/commands/import ) can be used, for example:
2022-09-21 13:45:56 -07:00
```shell
terraform import boundary_host_set_plugin.foo <my-id>
```