Skip to content

Commit

Permalink
Provide example import and resource
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchnielsen committed Feb 19, 2025
1 parent 7e2ed82 commit 62cc4ce
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
30 changes: 30 additions & 0 deletions docs/resources/work_queue.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,28 @@ The resource `work_queue` represents a Prefect Work Queue. Work Queues are used

Work Queues can be associated with a work pool and have configurations like concurrency limits

## Example Usage

```terraform
resource "prefect_workspace" "example" {
handle = "my-workspace"
name = "my-workspace"
}
resource "prefect_work_pool" "example" {
name = "my-work-pool"
type = "kubernetes"
paused = false
workspace_id = prefect_workspace.example.id
}
resource "prefect_work_queue" "example" {
name = "my-work-queue"
description = "My work queue"
concurrency_limit = 2
workspace_id = prefect_workspace.example.id
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand All @@ -37,3 +58,12 @@ Work Queues can be associated with a work pool and have configurations like conc
- `created` (String) Timestamp of when the resource was created (RFC3339)
- `id` (String) Work queue ID (UUID)
- `updated` (String) Timestamp of when the resource was updated (RFC3339)

## Import

Import is supported using the following syntax:

```shell
# Prefect Work Queues can be imported using work_pool_name,work_queue_name,workspace_id
terraform import prefect_work_queue.example kubernetes-work-pool,my-work-queue,00000000-0000-0000-0000-000000000000
```
2 changes: 2 additions & 0 deletions examples/resources/prefect_work_queue/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Prefect Work Queues can be imported using work_pool_name,work_queue_name,workspace_id
terraform import prefect_work_queue.example kubernetes-work-pool,my-work-queue,00000000-0000-0000-0000-000000000000
18 changes: 18 additions & 0 deletions examples/resources/prefect_work_queue/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
resource "prefect_workspace" "example" {
handle = "my-workspace"
name = "my-workspace"
}

resource "prefect_work_pool" "example" {
name = "my-work-pool"
type = "kubernetes"
paused = false
workspace_id = prefect_workspace.example.id
}

resource "prefect_work_queue" "example" {
name = "my-work-queue"
description = "My work queue"
concurrency_limit = 2
workspace_id = prefect_workspace.example.id
}

0 comments on commit 62cc4ce

Please sign in to comment.