diff --git a/docs/resources/worker.md b/docs/resources/worker.md index dbb2a471..fe1ed9fe 100644 --- a/docs/resources/worker.md +++ b/docs/resources/worker.md @@ -1,5 +1,4 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "boundary_worker Resource - terraform-provider-boundary" subcategory: "" description: |- @@ -12,16 +11,22 @@ The resource allows you to create a self-managed worker object. ## Example Usage +### Controller-led worker + ```terraform resource "boundary_worker" "controller_led" { scope_id = "global" - name = "worker 1" + name = "controller-led-worker-1" description = "self managed worker with controller led auth" } +``` +### Worker-led worker + +```terraform resource "boundary_worker" "worker_led" { scope_id = "global" - name = "worker 2" + name = "worker-led-worker-1" description = "self managed worker with worker led auth" worker_generated_auth_token = var.worker_generated_auth_token } diff --git a/examples/resources/boundary_worker/controller_led.tf b/examples/resources/boundary_worker/controller_led.tf new file mode 100644 index 00000000..1cdd541b --- /dev/null +++ b/examples/resources/boundary_worker/controller_led.tf @@ -0,0 +1,5 @@ +resource "boundary_worker" "controller_led" { + scope_id = "global" + name = "controller-led-worker-1" + description = "self managed worker with controller led auth" +} diff --git a/examples/resources/boundary_worker/main.tf b/examples/resources/boundary_worker/main.tf deleted file mode 100644 index 7955758b..00000000 --- a/examples/resources/boundary_worker/main.tf +++ /dev/null @@ -1,13 +0,0 @@ -resource "boundary_worker" "controller_led" { - scope_id = "global" - name = "worker 1" - description = "self managed worker with controller-led auth" - worker_generated_auth_token = var.worker_generated_auth_token -} - -resource "boundary_worker" "worker_led" { - scope_id = "global" - name = "worker 2" - description = "self managed worker with worker-led auth" - worker_generated_auth_token = var.worker_generated_auth_token -} \ No newline at end of file diff --git a/examples/resources/boundary_worker/resource.tf b/examples/resources/boundary_worker/worker_led.tf similarity index 51% rename from examples/resources/boundary_worker/resource.tf rename to examples/resources/boundary_worker/worker_led.tf index 49f427f7..c6d630a9 100644 --- a/examples/resources/boundary_worker/resource.tf +++ b/examples/resources/boundary_worker/worker_led.tf @@ -1,12 +1,6 @@ -resource "boundary_worker" "controller_led" { - scope_id = "global" - name = "worker 1" - description = "self managed worker with controller led auth" -} - resource "boundary_worker" "worker_led" { scope_id = "global" - name = "worker 2" + name = "worker-led-worker-1" description = "self managed worker with worker led auth" worker_generated_auth_token = var.worker_generated_auth_token } diff --git a/templates/resources/worker.md.tmpl b/templates/resources/worker.md.tmpl new file mode 100644 index 00000000..26f0e48f --- /dev/null +++ b/templates/resources/worker.md.tmpl @@ -0,0 +1,28 @@ +--- +page_title: "boundary_worker Resource - terraform-provider-boundary" +subcategory: "" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# boundary_worker (Resource) + +{{ .Description | trimspace }} + +## Example Usage + +### Controller-led worker + +{{tffile "examples/resources/boundary_worker/controller_led.tf"}} + +### Worker-led worker + +{{tffile "examples/resources/boundary_worker/worker_led.tf"}} + +{{ .SchemaMarkdown | trimspace }} + +## Import + +Import is supported using the following syntax: + +{{codefile "shell" "examples/resources/boundary_worker/import.sh" }}