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

405 when creating workspace_access resource with a Prefect Team #169

Closed robfreedy closed 2 months ago

robfreedy commented 2 months ago

Community Note

Terraform Version

Terraform v1.7.5
on darwin_arm64
+ provider registry.terraform.io/prefecthq/prefect v0.1.3

Affected Resource(s)

prefect_workspace_access - https://registry.terraform.io/providers/PrefectHQ/prefect/latest/docs/resources/workspace_access

Terraform Configuration Files

# Copy-paste your Terraform configurations here.
#
# For large Terraform configs, please use a service like Dropbox and share a link to the ZIP file.
# For security, you can also encrypt the files using our GPG public key:
#    https://www.hashicorp.com/security
#
# If reproducing the bug involves modifying the config file (e.g., apply a config,
# change a value, apply the config again, see the bug), then please include both:
# * the version of the config before the change, and
# * the version of the config after the change.

# Read down a default Workspace Role (or create your own)
data "prefect_workspace_role" "developer" {
  name = "Developer"
}

# Assign the Workspace Role to the Team
resource "prefect_workspace_access" "team_developer" {
  accessor_type     = "TEAM"
  accessor_id       = "43ff886e-1870-4068-9ed8-842ec9e44ef4"
  workspace_id      = "f579e720-7969-4ab8-93b7-2dfa784903e6"
  workspace_role_id = data.prefect_workspace_role.developer.id
}

Debug Output

https://gist.github.com/robfreedy/dca030736415aa6807bde311a10cf84c

Panic Output

Expected Behavior

Team should be given access to a particular workspace given Team ID, Workspace ID, Account ID, and Role ID

Actual Behavior

405 Method Not Allowed

Steps to Reproduce

  1. terraform apply

Important Factoids

References

In the resource docs for this resource, there is no mention of a team_id for the accessor_id parameter

https://registry.terraform.io/providers/PrefectHQ/prefect/latest/docs/resources/workspace_access#schema