Files
terraform-provider-threshold/docs/resources/target.md
T
96c688b879 cherry-picks for release 1.1.x (#382)
* fix: Allow users to set OIDC maxAge value to 0 to require immediate reauth (#364)

* fix: Allow users to set OIDC maxAge value to 0 to require immediate reauth

Previously, setting 0 as a value for maxAge in an OIDC resource block would not update Boundary, as it was getting treated as a nil value in the provider.
This fix addresses that issue, ensuring that both setting the value to 0 will require immediate reauthorisation, as well as removing the maxAge paramater defaulting the reauth time length to the TTL of the chose OIDC provider

* Update doc strings, fix imports, and run go generate

* add changes to CHANGELOG

* spelling: host_set_plugin exmaple to example

* Update target.md (#349)

Update docs for Target resource removing `scope_id` from `boundary_host` resources to prevent error

```
╷
│ Error: Unsupported argument
│
│   on main.tf line 79, in resource "boundary_host" "foo":
│   79:   scope_id        = boundary_scope.project.id
│
│ An argument named "scope_id" is not expected here.
```

* feature: add worker_filter option to Boundary Credential Store Vault (#375)

* feature: add worker_filter option to Boundary Credential Store Vault

* Update changelog

* chore: update deps

* small fixes for cherry-picks

* downgrade hclog

---------

Co-authored-by: mocofound <aharness@hashicorp.com>
Co-authored-by: Steven Zamborsky <97125550+stevenzamborsky@users.noreply.github.com>
Co-authored-by: Louis Ruch <louisruch@gmail.com>
2023-04-21 14:28:06 -04:00

4.6 KiB

page_title, subcategory, description
page_title subcategory description
boundary_target Resource - terraform-provider-boundary The target resource allows you to configure a Boundary target.

boundary_target (Resource)

The target resource allows you to configure a Boundary target.

Example Usage

resource "boundary_scope" "global" {
  global_scope = true
  scope_id     = "global"
}

resource "boundary_scope" "org" {
  name                     = "organization_one"
  description              = "My first scope!"
  scope_id                 = boundary_scope.global.id
  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
}

resource "boundary_credential_store_vault" "foo" {
  name        = "vault_store"
  description = "My first Vault credential store!"
  address     = "http://127.0.0.1:8200"      # change to Vault address
  token       = "s.0ufRo6XEGU2jOqnIr7OlFYP5" # change to valid Vault token
  scope_id    = boundary_scope.project.id
}

resource "boundary_credential_library_vault" "foo" {
  name                = "foo"
  description         = "My first Vault credential library!"
  credential_store_id = boundary_credential_store_vault.foo.id
  path                = "my/secret/foo" # change to Vault backend path
  http_method         = "GET"
  credential_type     = "username_password"
}

resource "boundary_host_catalog" "foo" {
  name        = "test"
  description = "test catalog"
  scope_id    = boundary_scope.project.id
  type        = "static"
}

resource "boundary_host" "foo" {
  type            = "static"
  name            = "foo"
  host_catalog_id = boundary_host_catalog.foo.id
  address         = "10.0.0.1"
}

resource "boundary_host" "bar" {
  type            = "static"
  name            = "bar"
  host_catalog_id = boundary_host_catalog.foo.id
  address         = "10.0.0.1"
}

resource "boundary_host_set" "foo" {
  type            = "static"
  name            = "foo"
  host_catalog_id = boundary_host_catalog.foo.id

  host_ids = [
    boundary_host.foo.id,
    boundary_host.bar.id,
  ]
}

resource "boundary_target" "foo" {
  name         = "foo"
  description  = "Foo target"
  type         = "tcp"
  default_port = "22"
  scope_id     = boundary_scope.project.id
  host_source_ids = [
    boundary_host_set.foo.id
  ]
  brokered_credential_source_ids = [
    boundary_credential_library_vault.foo.id
  ]
}

resource "boundary_target" "ssh_foo" {
  name         = "ssh_foo"
  description  = "Ssh target"
  type         = "ssh"
  default_port = "22"
  scope_id     = boundary_scope.project.id
  host_source_ids = [
    boundary_host_set.foo.id
  ]
  injected_application_credential_source_ids = [
    boundary_credential_library_vault.foo.id
  ]
}

resource "boundary_target" "address_foo" {
  name         = "address_foo"
  description  = "Foo target with an address"
  type         = "tcp"
  default_port = "22"
  scope_id     = boundary_scope.project.id
  address      = "127.0.0.1"
}

Schema

Required

  • scope_id (String) The scope ID in which the resource is created. Defaults to the provider's default_scope if unset.
  • type (String) The target resource type.

Optional

  • address (String) Optionally, a valid network address to connect to for this target. Cannot be used alongside host_source_ids.
  • brokered_credential_source_ids (Set of String) A list of brokered credential source ID's.
  • default_port (Number) The default port for this target.
  • description (String) The target description.
  • egress_worker_filter (String) Boolean expression to filter the workers used to access this target
  • host_source_ids (Set of String) A list of host source ID's. Cannot be used alongside address.
  • ingress_worker_filter (String) HCP Only. Boolean expression to filter the workers a user will connect to when initiating a session against this target
  • injected_application_credential_source_ids (Set of String) A list of injected application credential source ID's.
  • name (String) The target name. Defaults to the resource name.
  • session_connection_limit (Number)
  • session_max_seconds (Number)
  • worker_filter (String, Deprecated) Boolean expression to filter the workers for this target

Read-Only

  • id (String) The ID of the target.

Import

Import is supported using the following syntax:

terraform import boundary_target.foo <my-id>