Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Service Account on Webhooks #346

Open
EmilRex opened this issue Dec 20, 2024 · 0 comments · May be fixed by #348
Open

Support Service Account on Webhooks #346

EmilRex opened this issue Dec 20, 2024 · 0 comments · May be fixed by #348
Assignees
Labels
bug Something isn't working

Comments

@EmilRex
Copy link
Contributor

EmilRex commented Dec 20, 2024

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Terraform Version

Terraform v1.9.8
on darwin_arm64
+ provider registry.terraform.io/prefecthq/prefect v2.13.4

Affected Resource(s)

  • prefect_webhook

Terraform Configuration Files

resource "prefect_service_account" "service_account" {
  name = "service-account"
  account_role_name = "Member"
}

resource "prefect_webhook" "target_webhook" {
  name        = "webhook"
  enabled     = true
  template = jsonencode({
    event = "prefect.event.received"
    resource = {
      "prefect.resource.id"   = "prefect.event"
      "prefect.resource.name" = "Prefect Event"
    }
    data = "{{ body }}"
  })

  // NOTE: Not sure how service account would be passed, but perhaps something lile:
  // service_account_id = prefect_service_account.service_account.id
}

Debug Output

│ Error: Error during create Webhook
│ 
│   with prefect_webhook.target_webhook,
│   on main.tf line 42, in resource "prefect_webhook" "target_webhook":
│   42: resource "prefect_webhook" "target_webhook" {
│ 
│ Could not create Webhook, unexpected error: failed to create webhook: status code=422 Unprocessable Entity, error={"detail":"`service_account` required while webhook authentication
│ is enforced"}

Expected Behavior

Webhook resource should allow specifying a service account to use.

Actual Behavior

Webhook resource does not support service account.

Steps to Reproduce

  1. Enable require webhook auth on your Prefect Cloud account
  2. terraform apply
@EmilRex EmilRex added the bug Something isn't working label Dec 20, 2024
@parkedwards parkedwards self-assigned this Dec 20, 2024
@parkedwards parkedwards linked a pull request Dec 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants