{"id":37175145,"url":"https://github.com/taskcluster/terraform-provider-jsone","last_synced_at":"2026-01-14T20:27:25.015Z","repository":{"id":66185413,"uuid":"136228710","full_name":"taskcluster/terraform-provider-jsone","owner":"taskcluster","description":"A terraform provider for json-e templating","archived":true,"fork":false,"pushed_at":"2019-10-14T23:30:05.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-06-21T20:07:11.897Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taskcluster.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-05T20:03:18.000Z","updated_at":"2023-01-28T15:26:12.000Z","dependencies_parsed_at":"2023-11-28T05:15:07.284Z","dependency_job_id":null,"html_url":"https://github.com/taskcluster/terraform-provider-jsone","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/taskcluster/terraform-provider-jsone","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taskcluster%2Fterraform-provider-jsone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taskcluster%2Fterraform-provider-jsone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taskcluster%2Fterraform-provider-jsone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taskcluster%2Fterraform-provider-jsone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taskcluster","download_url":"https://codeload.github.com/taskcluster/terraform-provider-jsone/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taskcluster%2Fterraform-provider-jsone/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28434458,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T20:27:24.377Z","updated_at":"2026-01-14T20:27:25.001Z","avatar_url":"https://github.com/taskcluster.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSON-e Terraform Provider\n\nA provider with a single resource `jsone_template`. This works similarly to the `template_file` resource\nbut allows us to use json-e constructs like $map to transforms lists and such things.\n\nYou can use [the json-e documentation](https://taskcluster.github.io/json-e/) to find out more about\nhow to use the templates.\n\n## Usage\n\nFirst `go get -u github.com/taskcluster/terraform-provider-jsone`. At that point, if you have built terraform from\nsource, simply running `go install` for this package will work. Otherwise, follow along with\n[the official docs](https://www.terraform.io/docs/configuration/providers.html#third-party-plugins) on how to use\nthird party plugins.\n\nNow it is as simple as:\n\n```terraform\nlocals {\n  context = {\n    foo = \"bar\"\n    baz = [\"bing\", \"qux\"]\n  }\n}\n\ndata \"jsone_template\" \"service\" {\n  template = \"${file(\"${path.module}/service.yaml\")}\"\n  yaml_context = \"${jsonencode(local.context)}\"\n}\n\noutput \"rendered\" {\n  value = \"${data.jsone_template.service.rendered}\"\n}\n```\n\nThe resource takes a string called `template` and either a field called `context` or `yaml_context`.\nThese are mutually exclusive. `context` should be good enough for most cases and is just a terraform map,\nbut if you run into issues with how terraform handles mixed-type maps or need to pass in typed data, opt\nfor `yaml_context` which just takes a string containing yaml. Oftentimes using the terraform interpolation\nof `jsonencode` will be your best bet.\n\nYou can access the rendered template with `.rendered` much the same as with `template_file`. This will normally\nbe in `json` format unless you explicitely pass in `format = \"yaml\"` to the resource.\n\n### Multiple Templates\n\nIn some cases, it is useful to have multiple templates in the input file.\nIn this case, the `rendered` value is a list of JSON- (or YAML-) formatted rendered templates.\nUse the `jsone_templates` resource (note the plural) for this purpose.\n\n```yaml\n# service.yaml\n---\none: '{$eval: \"17 - 16\"}'\n---\ntwo: '{$eval: \"12 / 6\"}'\n```\n\n```terraform\ndata \"jsone_templates\" \"service\" {\n  template = \"${file(\"${path.module}/service.yaml\")}\"\n  yaml_context = \"${jsonencode(local.context)}\"\n}\n\noutput \"rendered\" {\n  value1 = \"${data.jsone_template.service.rendered[0]}\"\n  # --\u003e '{\"one\": 1}'\n  value2 = \"${data.jsone_template.service.rendered[1]}\"\n  # --\u003e '{\"two\": 2}'\n}\n```\n\n### Extra Functions\n\nThis provider adds a `base64encode()` function to the context that can be used as follows:\n\n```terraform\nfoo: {$eval: \"base64encode(something)\"}\n```\n\n# Development\n\nGo requirements are the same as Terraform itself (currently 1.9).\n\nIn a clean GOPATH, `go get github.com/taskcluster/terraform-provider-jsone`, then switch to that directory and run `go get -t ./...` to get dependencies.\nRun `go test ./..` to test.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaskcluster%2Fterraform-provider-jsone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaskcluster%2Fterraform-provider-jsone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaskcluster%2Fterraform-provider-jsone/lists"}