nukosuke / terraform-provider-zendesk

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

[wip] feat: dynamic content support #226

Open nukosuke opened 2 years ago

nukosuke commented 2 years ago
nukosuke commented 2 years ago

Manual test for create

dynamic_content_items.tf

resource "zendesk_dynamic_content_item" "loc-lang" {
  name            = "language"
  default_locale  = "en-US"

  variant {
    locale  = "en-US"
    content = "English (US)"
  }

  variant {
    locale  = "ja"
    content = "日本語"
    default = true
  }

  variant {
    locale  = "zh-tw"
    content = "繁體中文"
  }
}

terraform plan

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_dynamic_content_item.loc-lang will be created
  + resource "zendesk_dynamic_content_item" "loc-lang" {
      + default_locale = "en-US"
      + id             = (known after apply)
      + name           = "language"

      + variant {
          + content = "English (US)"
          + default = false
          + locale  = "en-US"
        }
      + variant {
          + content = "日本語"
          + default = true
          + locale  = "ja"
        }
      + variant {
          + content = "繁體中文"
          + default = false
          + locale  = "zh-tw"
        }
    }

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

apply

zendesk_dynamic_content_item.loc-lang: Creating...
zendesk_dynamic_content_item.loc-lang: Creation complete after 0s [id=xxxxxxxxxxxxx]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

tfstate

{
  "version": 4,
  "terraform_version": "1.1.8",
  "serial": 1,
  "lineage": "344b53ff-4634-68ce-2d58-67414e8f1b26",
  "outputs": {},
  "resources": [
    {
      "mode": "managed",
      "type": "zendesk_dynamic_content_item",
      "name": "loc-lang",
      "provider": "provider[\"registry.terraform.io/nukosuke/zendesk\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "default_locale": "ja",
            "id": "xxxxxxxxxxxxx",
            "name": "language",
            "variant": [
              {
                "content": "English (US)",
                "default": false,
                "locale": "en-US"
              },
              {
                "content": "日本語",
                "default": true,
                "locale": "ja"
              },
              {
                "content": "繁體中文",
                "default": false,
                "locale": "zh-tw"
              }
            ]
          },
          "sensitive_attributes": [],
          "private": "bnVsbA=="
        }
      ]
    }
  ]
}

Zendesk

スクリーンショット 2022-04-22 3 22 57