fivetran / terraform-provider-fivetran

Terraform Provider for Fivetran
https://fivetran.com
Apache License 2.0
40 stars 23 forks source link

fivetran_webhook triggers update when there are no changes and creates an error #262

Closed adrian-montero-hkkd closed 6 months ago

adrian-montero-hkkd commented 7 months ago

This is a follow up on an issue opened before: https://github.com/fivetran/terraform-provider-fivetran/issues/239

Describe the bug I had over 200+ webhooks setup and did no change to them and now all the webhooks show as "update" in plan although I did not change anything on them. So in the plan I get all the webhooks with this change: image And later get this result in the apply: image After I apply the plan and re-run a plan-apply cycle with no changes I get yet again this in the plan: image Just like if in the previous cycle that attribute was not changed in the webhook.

To Reproduce Create a webhook with the active property set to true and run plan/apply cycle twice, the error will show up on all cycles besides the first one.

resource "fivetran_webhook" "tf_webhook_prod" {
  type = "group"
  group_id = fivetran_group.fivetran_group.id
  url = "https://myurl.site.com"
  active = true
  events = [
    "sync_start",
    "sync_end",
    "create_connector",
    "pause_connector",
    "resume_connector",
    "delete_connector",
    "connection_successful",
    "connection_failure"
    ]
  secret = "<redacted>"
}

Expected behavior Create the webhook the first time and DO NOT trigger update when conditions in the definition do not change.

Plugin version: 1.1.13

beevital commented 6 months ago

Hey @adrian-montero-hkkd! I suspect that your webhooks were deactivated due to some reason: for example Fivetran wasn't able to deliver events. We de-activate webhooks that we can't deliver for a long period: please, read more about it here..

On activation we always checking if the url is active and ready to respond. If we can't deliver test event on activation we return: status code: 400; expected: 200; code: InvalidInput; message: Failed to call webhook endpoint:

On your screenshot I can't see message part, it looks like error message is trimmed or clipped. But I suspect the problem is that your url doesn't respond with 2xx - that's why you can't re-activate your webhooks.

If you'll share your group_id we can make an investigation and find out exact reason why and when your webhooks were de-activated.

There's no terraform problem here - provider works exactly as expected, so I have to close this issue.