Skip to content

feat: add support for webhook resource #234

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

Open
wants to merge 4 commits into
base: feature/dynamic-content
Choose a base branch
from

Conversation

nukosuke
Copy link
Owner

manual test

build
~/workspace/github.com/nukosuke/terraform-provider-zendesk/examples feature/webhook ───────────────────────────────────────────────────────────────────────────────────────────────────   api 03:19:34
❯ make install
mkdir -p build
go build -o build/terraform-provider-zendesk_v0.0.4 ../.
terraform plan
~/workspace/github.com/nukosuke/terraform-provider-zendesk/examples feature/webhook ──────────────────────────────────────────────────────────────────────────────────────────────── 3s   api 03:19:40
❯ terraform plan
╷
│ Warning: Provider development overrides are in effect
│ 
│ The following provider development overrides are set in the CLI configuration:
│  - nukosuke/zendesk in build
│ 
│ The behavior may therefore not match any released version of the provider and applying changes may cause the state to become incompatible with published releases.
╵

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # zendesk_webhook.example-basic-auth-webhook will be created
  + resource "zendesk_webhook" "example-basic-auth-webhook" {
      + endpoint       = "https://example.com/status/200"
      + http_method    = "POST"
      + id             = (known after apply)
      + name           = "Example Webhook with Basic Auth"
      + request_format = "json"
      + status         = "active"
      + subscriptions  = [
          + "conditional_ticket_events",
        ]

      + authentication {
          + add_position = "header"
          + data         = (sensitive value)
          + type         = "basic_auth"
        }
    }

  # zendesk_webhook.example-bearer-token-webhook will be created
  + resource "zendesk_webhook" "example-bearer-token-webhook" {
      + endpoint       = "https://example.com/status/200"
      + http_method    = "POST"
      + id             = (known after apply)
      + name           = "Example Webhook with Bearer token"
      + request_format = "json"
      + status         = "active"
      + subscriptions  = [
          + "conditional_ticket_events",
        ]

      + authentication {
          + add_position = "header"
          + data         = (sensitive value)
          + type         = "bearer_token"
        }
    }

  # zendesk_webhook.example-webhook will be created
  + resource "zendesk_webhook" "example-webhook" {
      + endpoint       = "https://example.com/status/200"
      + http_method    = "GET"
      + id             = (known after apply)
      + name           = "Example Webhook without authentication"
      + request_format = "json"
      + status         = "active"
      + subscriptions  = [
          + "conditional_ticket_events",
        ]
    }

Plan: 3 to add, 0 to change, 0 to destroy.

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Note: You didn't use the -out option to save this plan, so Terraform can't guarantee to take exactly these actions if you run "terraform apply" now.
terraform apply
~/workspace/github.com/nukosuke/terraform-provider-zendesk/examples feature/webhook ───────────────────────────────────────────────────────────────────────────────────────────────────   api 03:20:23
❯ terraform apply
╷
│ Warning: Provider development overrides are in effect
│ 
│ The following provider development overrides are set in the CLI configuration:
│  - nukosuke/zendesk in build
│ 
│ The behavior may therefore not match any released version of the provider and applying changes may cause the state to become incompatible with published releases.
╵

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # zendesk_webhook.example-basic-auth-webhook will be created
  + resource "zendesk_webhook" "example-basic-auth-webhook" {
      + endpoint       = "https://example.com/status/200"
      + http_method    = "POST"
      + id             = (known after apply)
      + name           = "Example Webhook with Basic Auth"
      + request_format = "json"
      + status         = "active"
      + subscriptions  = [
          + "conditional_ticket_events",
        ]

      + authentication {
          + add_position = "header"
          + data         = (sensitive value)
          + type         = "basic_auth"
        }
    }

  # zendesk_webhook.example-bearer-token-webhook will be created
  + resource "zendesk_webhook" "example-bearer-token-webhook" {
      + endpoint       = "https://example.com/status/200"
      + http_method    = "POST"
      + id             = (known after apply)
      + name           = "Example Webhook with Bearer token"
      + request_format = "json"
      + status         = "active"
      + subscriptions  = [
          + "conditional_ticket_events",
        ]

      + authentication {
          + add_position = "header"
          + data         = (sensitive value)
          + type         = "bearer_token"
        }
    }

  # zendesk_webhook.example-webhook will be created
  + resource "zendesk_webhook" "example-webhook" {
      + endpoint       = "https://example.com/status/200"
      + http_method    = "GET"
      + id             = (known after apply)
      + name           = "Example Webhook without authentication"
      + request_format = "json"
      + status         = "active"
      + subscriptions  = [
          + "conditional_ticket_events",
        ]
    }

Plan: 3 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

zendesk_webhook.example-webhook: Creating...
zendesk_webhook.example-bearer-token-webhook: Creating...
zendesk_webhook.example-basic-auth-webhook: Creating...
zendesk_webhook.example-bearer-token-webhook: Creation complete after 1s [id=01G1982EXJ6JPFMN4XXZ7WZBRE]
zendesk_webhook.example-basic-auth-webhook: Creation complete after 1s [id=01G1982EXGASJ6EE6X9G8M1R88]
zendesk_webhook.example-webhook: Creation complete after 1s [id=01G1982EY8WAQ0YVPW43GY60NN]

Apply complete! Resources: 3 added, 0 changed, 0 destroyed.
Zendesk スクリーンショット 2022-04-23 3 27 21

@nukosuke nukosuke requested a review from tamccall as a code owner April 22, 2022 18:28
@nukosuke nukosuke changed the base branch from master to feature/dynamic-content April 22, 2022 18:30
@nukosuke nukosuke force-pushed the feature/dynamic-content branch from 2efe27c to 92957b5 Compare April 22, 2022 18:31
@nukosuke nukosuke added the Resource Issues & PRs about Zendesk resources label Apr 22, 2022
@nukosuke nukosuke self-assigned this Apr 22, 2022
@nukosuke nukosuke added this to the v0.1.0 milestone Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resource Issues & PRs about Zendesk resources
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant