diff --git a/docs/resources/worker.md b/docs/resources/worker.md index fe1ed9fe..968d4c94 100644 --- a/docs/resources/worker.md +++ b/docs/resources/worker.md @@ -21,6 +21,9 @@ resource "boundary_worker" "controller_led" { } ``` +Use controller-led registration when Terraform can deliver a generated activation +token to the worker. Omit `worker_generated_auth_token`. + ### Worker-led worker ```terraform @@ -32,6 +35,34 @@ resource "boundary_worker" "worker_led" { } ``` +Use worker-led registration when the worker generates the authorization request. +Set `worker_generated_auth_token` to the generated token. + +### No managed worker resource + +Without a `boundary_worker` resource, Terraform does not manage a worker. + +### Both registration methods + +Configure separate `boundary_worker` resources when your deployment requires +both registration methods. + +```terraform +resource "boundary_worker" "controller_led" { + scope_id = "global" + name = "controller-led-worker-1" +} + +resource "boundary_worker" "worker_led" { + scope_id = "global" + name = "worker-led-worker-1" + worker_generated_auth_token = var.worker_generated_auth_token +} +``` + +Refer to the [register workers](https://developer.hashicorp.com/boundary/docs/workers/registration) +documentation to learn about worker registration. + ## Schema diff --git a/examples/resources/boundary_worker/both.tf b/examples/resources/boundary_worker/both.tf new file mode 100644 index 00000000..a22db748 --- /dev/null +++ b/examples/resources/boundary_worker/both.tf @@ -0,0 +1,10 @@ +resource "boundary_worker" "controller_led" { + scope_id = "global" + name = "controller-led-worker-1" +} + +resource "boundary_worker" "worker_led" { + scope_id = "global" + name = "worker-led-worker-1" + worker_generated_auth_token = var.worker_generated_auth_token +} diff --git a/templates/resources/worker.md.tmpl b/templates/resources/worker.md.tmpl index 26f0e48f..7bc5638d 100644 --- a/templates/resources/worker.md.tmpl +++ b/templates/resources/worker.md.tmpl @@ -15,10 +15,30 @@ description: |- {{tffile "examples/resources/boundary_worker/controller_led.tf"}} +Use controller-led registration when Terraform can deliver a generated activation +token to the worker. Omit `worker_generated_auth_token`. + ### Worker-led worker {{tffile "examples/resources/boundary_worker/worker_led.tf"}} +Use worker-led registration when the worker generates the authorization request. +Set `worker_generated_auth_token` to the generated token. + +### No managed worker resource + +Without a `boundary_worker` resource, Terraform does not manage a worker. + +### Both registration methods + +Configure separate `boundary_worker` resources when your deployment requires +both registration methods. + +{{tffile "examples/resources/boundary_worker/both.tf"}} + +Refer to the [register workers](https://developer.hashicorp.com/boundary/docs/workers/registration) +documentation to learn about worker registration. + {{ .SchemaMarkdown | trimspace }} ## Import