{"id":15065533,"url":"https://github.com/robert-oleynik/tf-bindgen","last_synced_at":"2025-04-10T16:40:21.736Z","repository":{"id":153233745,"uuid":"606124498","full_name":"robert-oleynik/tf-bindgen","owner":"robert-oleynik","description":"Automatically generates bindings for Rust to build Terraform infrastructure.","archived":false,"fork":false,"pushed_at":"2023-04-18T15:57:32.000Z","size":321,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-24T05:16:50.256Z","etag":null,"topics":["codegen","rust","terraform"],"latest_commit_sha":null,"homepage":"https://robert-oleynik.github.io/tf-bindgen/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robert-oleynik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2023-02-24T16:49:54.000Z","updated_at":"2024-04-24T05:16:50.258Z","dependencies_parsed_at":null,"dependency_job_id":"afad8e94-8e8b-470c-b86a-d2c592545586","html_url":"https://github.com/robert-oleynik/tf-bindgen","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robert-oleynik%2Ftf-bindgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robert-oleynik%2Ftf-bindgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robert-oleynik%2Ftf-bindgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robert-oleynik%2Ftf-bindgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robert-oleynik","download_url":"https://codeload.github.com/robert-oleynik/tf-bindgen/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248252724,"owners_count":21072702,"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":["codegen","rust","terraform"],"created_at":"2024-09-25T00:40:25.430Z","updated_at":"2025-04-10T16:40:21.712Z","avatar_url":"https://github.com/robert-oleynik.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tf-bindgen\n\n[![docs](https://img.shields.io/badge/docs-online-success)](https://robert-oleynik.github.io/tf-bindgen/)\n[![crates](https://img.shields.io/crates/v/tf-bindgen)](https://crates.io/crates/tf-bindgen)\n\n`tf-bindgen` can be used to generate Rust bindings for [Terraform] providers and\nto deploy your infrastructure.\nThis library will replicate most features of [CDK for Terraform] but written in Rust.\n\n[Terraform]: https://www.terraform.io/\n[CDK for Terraform]: https://developer.hashicorp.com/terraform/cdktf\n\n## Requirements\n\nRequired tools:\n\n- `cargo`\n- `terraform`\n\n## What is `tf-bindgen`?\n\n`tf-bindgen` is a code generator which will generate Rust code to configure infrastructure using [Terraform](https://www.terraform.io/). The following example shows how to use `tf-bindgen` to configure a Kubernetes pod running nginx:\n\n```rust\nfn init() -\u003e Stack {\n\tlet stack = Stack::new(\"nginx\");\n\n\t/// Configure Resources using a builder\n\tlet metadata = KubernetesNamespaceMetadata::builder()\n\t\t.name(\"nginx\")\n\t\t.build();\n\tlet namespace = KubernetesNamespace::create(\u0026stack, \"nginx-namespace\")\n\t\t.metadata(metadata)\n\t\t.build();\n\n\t/// Configure Resources using the resource! macro\n\tresource! {\n\t\t\u0026stack, resource \"kubernetes_pod\" \"nginx\" {\n\t\t\tmetadata {\n\t\t\t\tnamespace = \u0026namespace.metadata[0].name\n\t\t\t\tname = \"nginx\"\n\t\t\t}\n\t\t\tspec {\n\t\t\t\tcontainer {\n\t\t\t\t\tname = \"nginx\"\n\t\t\t\t\timage = \"nginx\"\n\t\t\t\t\tport {\n\t\t\t\t\t\tcontainer_port = 80\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\tstack\n}\n```\n\nSee [Documentation](https://robert-oleynik.github.io/tf-bindgen/introduction.html) for a full introduction into `tf-bindgen`.\n\n## Examples\n\nFor a list of examples, see the [Examples](https://robert-oleynik.github.io/tf-bindgen/examples.html) section of the documentation.\n\n## Issues\n\n### Compile Performance\n\nSome Providers like [tf-kubernetes](https://github.com/robert-oleynik/tf-kubernetes) will generate large bindings, resulting in long compile durations. If you have this issue, please see the [Improving Compile Duration](https://robert-oleynik.github.io/tf-bindgen/advanced/improving_compile_duration.html) section.\n\n## Roadmap\n\n**v0.1:**\n\n- [x] generate Rust code for Terraform provider\n  - [x] implement data blocks\n  - [x] implement resource blocks\n- [x] add support for variable references\n- [x] generate Rust code from Terraform modules\n- [x] add code generator `tf_bindgen::codegen::resource`\n- [x] add Construct derive macro\n- [x] create Markdown book\n\n**v0.2:**\n\n- [ ] Add support for Outputs in constructs\n- [ ] Add Macro to generate CLI application\n- [ ] Add `format!` for Value types\n- [ ] Remove derive macros from generated source code\n\n## Limitations\n\nAs mentioned above, this library will replicate features provided by [CDK for Terraform].\nIt is not a one to one replacement for Rust and will be different in some aspects\nof the implementation:\n\n1. `cdktf` (library and CLI application) are not needed to use this library\n2. `tf-bindgen` constructs are not compatible with CDK constructs.\n\n## Contributing\n\n\u003c!-- TODO: add placeholder text --\u003e\n\n## License\n\nThis project is licensed under the [BSD-3-Clause](./LICENSE) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobert-oleynik%2Ftf-bindgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobert-oleynik%2Ftf-bindgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobert-oleynik%2Ftf-bindgen/lists"}