nukosuke / terraform-provider-zendesk

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

Support for complex trigger action values #166

Closed jlsalmon closed 5 years ago

jlsalmon commented 5 years ago

This PR builds on top of the currently unmerged #140, adding support for CRUD operations on trigger actions with complex values (such as JSON payloads) commonly used in integrations with e.g. Zapier, PagerDuty, JIRA etc.

The following now works:

trigger.tf:

resource "zendesk_trigger" "json-target" {
    title = "notification_target trigger with JSON payload"

    // ...

    action {
        field = "notification_target"
        value = jsonencode([
            "1234"
            data.template_file.payload.rendered
        ])
    }
}

data "template_file" "payload" {
    template = file("${path.module}/trigger_payload.json.tpl")
    vars = {
        // ...
    }
}

TODO:

tamccall commented 5 years ago

Hi @jlsalmon looks like your are having trouble with the master build.

I think that build has been removed from master at this point so if you merge that into your pr it will probably resolve itself.

jlsalmon commented 5 years ago

Thanks @tamccall, I've rebased the original branch on to master. I had to update go.mod to get the builds to pass - apologies if I've not done this correctly, I'm not super familiar with golang modules yet.

nukosuke commented 5 years ago

@jlsalmon Thank you for taking over the work! LGTM 👍

@tamccall upgrading v0.11 -> v0.12 would probably break backward compatibility. But, I think that it's about time to support v0.12 and drop v0.11 if necessary. How do you feel about that?

nukosuke commented 5 years ago

@jlsalmon I created new branch terraform-v0.12 to aggregate all changes for supporting v0.12, and rebased your PRs to it.