franckverrot / terraform-provider-stripe

A Terraform Provider for Stripe
https://registry.terraform.io/providers/franckverrot/stripe/latest
Mozilla Public License 2.0
242 stars 51 forks source link

Stripe connect webhook incorrectly set #65

Open half2me opened 2 years ago

half2me commented 2 years ago

Hi, I noticed when creating two webhooks:

resource "stripe_webhook_endpoint" "stripe" {
  url = "${aws_api_gateway_stage.stage.invoke_url}${aws_api_gateway_resource.stripe.path}"

  enabled_events = [
    "charge.captured",
    "charge.expired",
    "charge.failed",
    "charge.pending",
    "charge.refund.updated",
    "charge.refunded",
    "charge.succeeded",
    "charge.updated",
    "checkout.session.async_payment_failed",
    "checkout.session.async_payment_succeeded",
    "checkout.session.completed",
  ]
}

resource "stripe_webhook_endpoint" "stripe-connect" {
  url     = "${aws_api_gateway_stage.stage.invoke_url}${aws_api_gateway_resource.stripe-connect.path}"
  connect = true

  enabled_events = [
    "account.application.deauthorized",
    "account.updated",
    "charge.captured",
    "charge.refund.updated",
    "charge.refunded",
    "checkout.session.async_payment_failed",
    "checkout.session.async_payment_succeeded",
    "checkout.session.completed",
    "customer.deleted",
  ]
}

Both webhooks are being created as type "Account" instead of the second one as type "Connect"

When running terraform apply again, it sees this, and shows me in the plan, that it will change the type to "connect". However, no matter how many times I run terraform apply it "succeeds" but never changes the type.