nukosuke / terraform-provider-zendesk

Terraform Zendesk provider
https://registry.terraform.io/providers/nukosuke/zendesk/latest/docs
MIT License
26 stars 18 forks source link

feat: add support for webhook resource #234

Open nukosuke opened 2 years ago

nukosuke commented 2 years ago

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