Skip to content

Inconsistent subscription types in the webhook resource #433

@offbyone

Description

@offbyone

Describe the bug

I am attempting to model my existing tailnet configuration in terraform. I've imported my current webhook configuration, which left me with this plan:

  # module.tailnet.tailscale_webhook.discord must be replaced
-/+ resource "tailscale_webhook" "discord" {
      ~ id            = "wQRtqs3CNTRL" -> (known after apply)
      - provider_type = "discord" -> null # forces replacement
      + secret        = (sensitive value)
      - subscriptions = [
          - "categoryDeviceMisconfigurations",
          - "categoryTailnetManagement",
        ] -> null
        # (1 unchanged attribute hidden)

So, I updated my terraform to add those:

resource "tailscale_webhook" "discord" {
  endpoint_url = var.discord_webhook_url
  subscriptions = [
    "categoryDeviceMisconfigurations",
    "categoryTailnetManagement"
  ]
}

And now my plan results in an error:

│ Error: expected subscriptions.0 to be one of ["nodeCreated" "nodeNeedsApproval" "nodeApproved" "nodeKeyExpiringInOneDay" "nodeKeyExpired" "nodeDeleted" "policyUpdate" "userCreated" "userNeedsApproval" "userSuspended" "userRestored" "userDeleted" "userApproved" "userRoleUpdated" "subnetIPForwardingNotEnabled" "exitNodeIPForwardingNotEnabled"], got categoryDeviceMisconfigurations
│
│   with module.tailnet.tailscale_webhook.discord,
│   on tailnet/tailnet.tf line 3, in resource "tailscale_webhook" "discord":
│    3:   subscriptions = [
│    4:     "categoryDeviceMisconfigurations",
│    5:     "categoryTailnetManagement"
│    6:   ]
$ terraform version
Terraform v1.3.6
on darwin_arm64
... other providers
+ provider registry.terraform.io/tailscale/tailscale v0.17.0

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions