{"id":13638945,"url":"https://github.com/poseidon/terraform-provider-cue","last_synced_at":"2025-04-19T21:35:13.769Z","repository":{"id":59043218,"uuid":"527081463","full_name":"poseidon/terraform-provider-cue","owner":"poseidon","description":"Terraform provider for evaluting CUE to render JSON","archived":false,"fork":false,"pushed_at":"2024-08-15T20:02:52.000Z","size":114,"stargazers_count":12,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-08-15T21:56:59.221Z","etag":null,"topics":["cue","terraform","terraform-provider"],"latest_commit_sha":null,"homepage":"https://registry.terraform.io/providers/poseidon/cue/latest/docs","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/poseidon.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"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},"funding":{"github":["poseidon","dghubble"]}},"created_at":"2022-08-21T01:52:12.000Z","updated_at":"2024-08-15T20:02:55.000Z","dependencies_parsed_at":"2024-03-20T21:29:57.619Z","dependency_job_id":"c8f5e3a6-7544-4e6b-9f53-177cf5c81a80","html_url":"https://github.com/poseidon/terraform-provider-cue","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poseidon%2Fterraform-provider-cue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poseidon%2Fterraform-provider-cue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poseidon%2Fterraform-provider-cue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poseidon%2Fterraform-provider-cue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/poseidon","download_url":"https://codeload.github.com/poseidon/terraform-provider-cue/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223810226,"owners_count":17206718,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cue","terraform","terraform-provider"],"created_at":"2024-08-02T01:00:55.684Z","updated_at":"2024-11-09T09:30:26.518Z","avatar_url":"https://github.com/poseidon.png","language":"Go","funding_links":["https://github.com/sponsors/poseidon","https://github.com/sponsors/dghubble"],"categories":["Projects"],"sub_categories":[],"readme":"# terraform-provider-cue\n[![GoDoc](https://pkg.go.dev/badge/github.com/poseidon/terraform-provider-cue.svg)](https://pkg.go.dev/github.com/poseidon/terraform-provider-cue)\n[![Workflow](https://github.com/poseidon/terraform-provider-cue/actions/workflows/test.yaml/badge.svg)](https://github.com/poseidon/terraform-provider-cue/actions/workflows/test.yaml?query=branch%3Amain)\n![Downloads](https://img.shields.io/github/downloads/poseidon/terraform-provider-cue/total)\n[![Sponsors](https://img.shields.io/github/sponsors/poseidon?logo=github)](https://github.com/sponsors/poseidon)\n[![Mastodon](https://img.shields.io/badge/follow-news-6364ff?logo=mastodon)](https://fosstodon.org/@poseidon)\n\n`terraform-provider-cue` allows Terraform to evaluate [CUE](https://cuelang.org/docs/) configs and render JSON for use in Terraform.\n\n\u003cdetails\u003e\n  \u003csummary\u003eAuthor's Note\u003c/summary\u003e\n  CUE has potential to be a better Jsonnet (if it gets a proper module manager). But like Jsonnet, its usage should be limited to preparing JSON-only configs where there are no viable alternatives (e.g. Grafana dashboards). Prefer native Terraform where possible, its ecosystem and design is simpler, more powerful, more mature, and ubiquitous.\n\u003c/details\u003e\n\n## Usage\n\nConfigure the `cue` provider (e.g. `providers.tf`).\n\n```tf\nprovider \"cue\" {}\n\nterraform {\n  required_providers {\n    ct = {\n      source  = \"poseidon/cue\"\n      version = \"0.4.1\"\n    }\n  }\n}\n```\n\nRun `terraform init` to ensure version requirements are met.\n\n```\n$ terraform init -upgrade\n```\n\nDefine a `cue_config` data source to validate CUE `content`.\n\n```tf\ndata \"cue_config\" \"example\" {\n  pretty_print = true\n  content = \u003c\u003c-EOT\n    a: 1\n    b: 2\n    sum: a + b\n    _hidden: 3\n    l: [a, b]\n\n    map: [string]:int\n    map: {a: 1 * 5}\n    map: {\"b\": b * 5}\n  EOT\n}\n```\n\nOptionally provide `paths` to CUE files (supports imports).\n\n```tf\ndata \"cue_config\" \"example\" {\n  paths = [\n    \"core.cue\",\n    \"box.cue\",\n  ]\n}\n```\n\nOr unify `content` and `path` based expressions together.\n\n```tf\ndata \"cue_config\" \"example\" {\n  paths = [\n    \"partial.cue\",\n  ]\n  content = \u003c\u003c-EOT\n    package example\n\n    _config: {\n      name: \"ACME\"\n      amount: \"$20.00\"\n    }\n  EOT\n}\n```\n\nCustomize the root directory CUE uses during loading (defaults to current directory).\n\n```\ndata \"cue_config\" \"example\" {\n  paths = [\n    \"foo.cue\",\n  ]\n  dir = \"internal/testmod\"\n  pretty_print = false\n}\n```\n\nRender the CUE config as JSON for use in Terraform expressions.\n\n```tf\noutput \"out\" {\n  description = \"Show Cue rendered as JSON\"\n  value       = data.cue_config.example.rendered\n}\n```\n\nThe rendered `content` example looks like:\n\n```json\n{\n  \"a\": 1,\n  \"b\": 2,\n  \"sum\": 3,\n  \"l\": [\n    1,\n    2\n  ],\n  \"map\": {\n    \"a\": 5,\n    \"b\": 10\n  }\n}\n```\n\n## Requirements\n\n* Terraform v1.0+ [installed](https://www.terraform.io/downloads.html)\n\n## Development\n\n### Binary\n\nTo develop the provider plugin locally, build an executable with Go v1.18+.\n\n```\nmake\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposeidon%2Fterraform-provider-cue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposeidon%2Fterraform-provider-cue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposeidon%2Fterraform-provider-cue/lists"}