{"id":24290160,"url":"https://github.com/cda0/terrajs","last_synced_at":"2025-07-01T09:39:17.679Z","repository":{"id":34723925,"uuid":"182963667","full_name":"CDA0/terrajs","owner":"CDA0","description":"Node wrapper for terraform","archived":false,"fork":false,"pushed_at":"2023-01-23T10:48:25.000Z","size":461,"stargazers_count":7,"open_issues_count":10,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-24T00:06:43.795Z","etag":null,"topics":["aws","azure","dev","devops","infrastructure","nodejs","terraform","wrapper"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CDA0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-23T07:54:29.000Z","updated_at":"2024-05-17T17:48:06.000Z","dependencies_parsed_at":"2023-02-12T22:30:50.513Z","dependency_job_id":null,"html_url":"https://github.com/CDA0/terrajs","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/CDA0/terrajs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CDA0%2Fterrajs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CDA0%2Fterrajs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CDA0%2Fterrajs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CDA0%2Fterrajs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CDA0","download_url":"https://codeload.github.com/CDA0/terrajs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CDA0%2Fterrajs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262938046,"owners_count":23387721,"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":["aws","azure","dev","devops","infrastructure","nodejs","terraform","wrapper"],"created_at":"2025-01-16T11:16:31.804Z","updated_at":"2025-07-01T09:39:17.648Z","avatar_url":"https://github.com/CDA0.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terrajs\n\n[![Build Status](https://travis-ci.org/CDA0/terrajs.svg?branch=master)](https://travis-ci.org/CDA0/terrajs)\n[![npm version](https://badge.fury.io/js/%40cda0%2Fterrajs.svg)](https://badge.fury.io/js/%40cda0%2Fterrajs)\n\nA module to help with creating Terraform commands.\n\n## Supported Commands\n\n- `apply`\n- `fmt`\n- `get`\n- `graph`\n- `import`\n- `init`\n- `output`\n- `plan`\n- `providers`\n- `refresh`\n- `show`\n- `taint`\n- `untaint`\n- `validate`\n- `version`\n- `workspace`\n  - `delete`\n  - `list`\n  - `new`\n  - `select`\n  - `show`\n\n## Usage\n\nTerrajs will run Terraform commands from the directory passed in with `terraformDir`.\n\n```js\nconst tf = new Terrajs( { terraformDir: 'path/to/configuration' } );\nawait tf.init({ backendConfig: { key: 'MY_KEY' } });\n```\n\nTo view the generated Terraform command without running:\n\n```js\nconst tf = new Terrajs({ execute: false, terraformDir: 'path/to/configuration' });\nconsole.log(await tf.init({ backendConfig: { key: 'MY_KEY' } }));\n```\n\nIf you need to use a Terraform binary that's not on your path as `terraform`,\nthen you can tell Terrajs where to find it in the constructor.\n\n```js\nconst tf = new Terrajs( { command: 'terraform12', terraformDir: 'path/to/configuration' } );\nawait tf.init({ backendConfig: { key: 'MY_KEY' } });\n```\n\nSee `example.js` for a quick impression of how to use the extra commands.\n\n### Variables\n\nVariables are mapped from JavaScript camelCase convention to Terraform CLI snake_case convention. For example:\n\n```js\nawait tf.plan({\n  var: {\n    subscriptionId: '123',\n    tenantId: 'abc',\n    zones: ['A', 'B'],\n  }\n});\n```\n\n...will be mapped to the following command:\n\n```bash\nterraform plan -var \"subscription_id=123\" -var \"tenant_id=abc\" -var 'zones=[\"A\",\"B\"]'\n```\n\n...or on Windows (Command Prompt):\n\n```batch\nterraform plan -var \"subscription_id=123\" -var \"tenant_id=abc\" -var \"zones=[\\\"A\\\",\\\"B\\\"]\"\n```\n\nIf variables are not being represented as you expect,\nplease set `TF_LOG=trace` and check to see what Terraform is receiving.\nTerrajs uses the default shell assumed by [`child_process`][child-process] which is generally `/bin/sh` and `cmd.exe` (on Windows).\nIf a variable's value is quite complex with special characters,\nthis may cause problems with the shell's interpolation.\n\n## Test\n\n`npm run test`\n\n## Coverage\n\n`npm run coverage`\n\n## Contributing\n\nTerraform commands live in the `templates` directory.\n\nEach command has a line for each partial, found in the `partials` directory.\n\nA partial contains the logic for a command line argument.\n\n[child-process]: https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcda0%2Fterrajs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcda0%2Fterrajs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcda0%2Fterrajs/lists"}