PrefectHQ / terraform-provider-prefect

Terraform Provider for Prefect Cloud
https://registry.terraform.io/providers/PrefectHQ/prefect/latest/docs
Apache License 2.0
29 stars 13 forks source link

chore: error messaging for missing workspaceID + improved work pool import parameter #119

Closed parkedwards closed 8 months ago

parkedwards commented 8 months ago

resolves https://github.com/PrefectHQ/terraform-provider-prefect/issues/99

  1. Makes clearer error messages around when a workspaceID or accountID is not passed into a client
  2. extends the work_pool import interface, so that we can import on the command line by passing an optional workspace_id. Comma separate example taken from the TF docs
# workspace_id,name
terraform import prefect_work_pool.example 00000000-0000-0000-0000-000000000000,kubernetes-work-pool

# name only
terraform import prefect_work_pool.example kubernetes-work-pool

The reason for adding this is that the provider makes workspace_id optional. This makes sense for use cases where an operator does not want the provider to be tied to a specific workspace (eg. it has account-level permissions and scope). However, in the previous implementation, an import would fail if the provider was not configured with a workspace_id. This change offers an optional import path for those who want to keep the provider account-level only