* feat(proj-alias): support project scoped alias via suffixes * fix: generate resouce docs using make gen * fix: address review comments * chore: make gen changes * fix(proja-alias): validate scope id before calling remove alias suffix * fix: filter unknown scopes in validation
133 lines
3.8 KiB
Markdown
133 lines
3.8 KiB
Markdown
---
|
|
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
|
page_title: "boundary_alias_target Resource - terraform-provider-boundary"
|
|
subcategory: ""
|
|
description: |-
|
|
The target alias resource allows you to configure a Boundary target alias at project and global scopes.
|
|
---
|
|
|
|
# boundary_alias_target (Resource)
|
|
|
|
The target alias resource allows you to configure a Boundary target alias at project and global scopes.
|
|
|
|
## Example Usage
|
|
|
|
```terraform
|
|
resource "boundary_scope" "org" {
|
|
name = "organization_one"
|
|
description = "global 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
|
|
}
|
|
|
|
resource "boundary_scope_alias_suffix" "org" {
|
|
scope_id = boundary_scope.org.id
|
|
alias_suffix = "org"
|
|
}
|
|
|
|
resource "boundary_scope_alias_suffix" "project" {
|
|
scope_id = boundary_scope.project.id
|
|
alias_suffix = "projectone"
|
|
}
|
|
|
|
resource "boundary_host_catalog_static" "foo" {
|
|
name = "test"
|
|
description = "test catalog"
|
|
scope_id = boundary_scope.project.id
|
|
}
|
|
|
|
resource "boundary_host_static" "foo" {
|
|
name = "foo"
|
|
host_catalog_id = boundary_host_catalog_static.foo.id
|
|
address = "10.0.0.1"
|
|
}
|
|
|
|
resource "boundary_host_static" "bar" {
|
|
name = "bar"
|
|
host_catalog_id = boundary_host_catalog_static.foo.id
|
|
address = "127.0.0.1"
|
|
}
|
|
|
|
resource "boundary_host_set_static" "foo" {
|
|
name = "foo"
|
|
host_catalog_id = boundary_host_catalog_static.foo.id
|
|
|
|
host_ids = [
|
|
boundary_host_static.foo.id,
|
|
boundary_host_static.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_static.foo.id,
|
|
]
|
|
}
|
|
|
|
resource "boundary_alias_target" "example_alias_target" {
|
|
name = "example_alias_target"
|
|
description = "Example alias to target foo using host boundary_host_static.bar"
|
|
scope_id = "global"
|
|
value = "example.bar.foo.boundary"
|
|
destination_id = boundary_target.foo.id
|
|
authorize_session_host_id = boundary_host_static.bar.id
|
|
}
|
|
|
|
resource "boundary_alias_target" "example_alias_target_project" {
|
|
name = "example_alias_target_project"
|
|
description = "Example project-scoped alias to target foo"
|
|
scope_id = boundary_scope.project.id
|
|
value = "prodops.projectone.org"
|
|
destination_id = boundary_target.foo.id
|
|
authorize_session_host_id = boundary_host_static.bar.id
|
|
depends_on = [
|
|
boundary_scope_alias_suffix.org,
|
|
boundary_scope_alias_suffix.project,
|
|
]
|
|
}
|
|
```
|
|
|
|
<!-- schema generated by tfplugindocs -->
|
|
## Schema
|
|
|
|
### Required
|
|
|
|
- `scope_id` (String) The scope ID. Org scopes are not supported for aliases.
|
|
- `value` (String) The value of the alias.
|
|
|
|
### Optional
|
|
|
|
- `authorize_session_host_id` (String) The host id to pass to Boundary when performing an authorize session action.
|
|
- `description` (String) The alias description.
|
|
- `destination_id` (String) The destination of the alias.
|
|
- `name` (String) The alias name. Defaults to the resource name.
|
|
- `type` (String) The type of alias; hardcoded.
|
|
|
|
### Read-Only
|
|
|
|
- `id` (String) The ID of the account.
|
|
|
|
## Import
|
|
|
|
Import is supported using the following syntax:
|
|
|
|
The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:
|
|
|
|
```shell
|
|
terraform import boundary_alias_target.example_alias_target <my-id>
|
|
terraform import boundary_alias_target.example_alias_target_project <my-id>
|
|
```
|