{"id":22092380,"url":"https://github.com/bhoriuchi/terraform-provider-javascript","last_synced_at":"2026-05-03T01:39:40.403Z","repository":{"id":142640000,"uuid":"95893508","full_name":"bhoriuchi/terraform-provider-javascript","owner":"bhoriuchi","description":"JavaScript provider for Terraform","archived":false,"fork":false,"pushed_at":"2017-07-05T16:38:24.000Z","size":13,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-06T13:45:40.718Z","etag":null,"topics":["javascript","json","provider","resource","terraform","terraform-modules","terraform-provider"],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/bhoriuchi.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,"zenodo":null}},"created_at":"2017-06-30T13:59:54.000Z","updated_at":"2022-07-22T14:08:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"7c6809ce-24ca-4ee3-8dbd-eab91a838cca","html_url":"https://github.com/bhoriuchi/terraform-provider-javascript","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bhoriuchi/terraform-provider-javascript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhoriuchi%2Fterraform-provider-javascript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhoriuchi%2Fterraform-provider-javascript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhoriuchi%2Fterraform-provider-javascript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhoriuchi%2Fterraform-provider-javascript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bhoriuchi","download_url":"https://codeload.github.com/bhoriuchi/terraform-provider-javascript/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhoriuchi%2Fterraform-provider-javascript/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013617,"owners_count":26085298,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["javascript","json","provider","resource","terraform","terraform-modules","terraform-provider"],"created_at":"2024-12-01T03:09:17.872Z","updated_at":"2025-10-13T00:10:07.396Z","avatar_url":"https://github.com/bhoriuchi.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terraform Javascript Provider\n\nThe JavaScript provider is used to perform javascript operations on data\nobtained during Terraform runs. For example a resource has a property that is\na JSON formatted string, and you need the value from one of the nested properties\nyou can use the JavaScript provider to parse the JSON string and return the value.\n\nThe provider uses [`otto`](https://github.com/robertkrimen/otto) to run JavaScript\ncode and includes the underscore library.\n\n**Example Usage**\n\n```\nvariable \"data\" {\n  type = \"string\"\n  default = \"{\\\"foo\\\": \\\"bar\\\"}\"\n}\n\nprovider \"javascript\" {}\n\nresource \"javascript_script\" \"s\" {\n  script = \"context.foo = JSON.parse(context.json_string).foo\"\n  context = {\n    json_string = \"${var.data}\"\n  }\n}\n\noutput val {\n  value = \"${javascript_script.s.context.foo}\"\n}\n\n// val = \"bar\"\n```\n\n---\n\n**Argument Reference**\n\nThe JavaScript provider currently takes no arguments\n\n## Resources\n\n* [javascript_script]()\n\n### javascript_script\n\nRuns a piece of javascript code and returns an updated context object. The context\nobject can be set with initial values an can be updated by the script by referencing\nit with `context.*`. The global variable `operation` is also set and available to\nthe script. This allows for specific code to be run based on the operation type.\nPlease note that all values in context are converted to strings due to the way\nterraform handles `TypeMap` values\n\n**Argument Reference**\n\n* `script` - (Required) The javascript to run\n* `context` - (Optional) Optional `TypeMap` to make available in the script\n\n### Building\n\nIf the builds in the current release do not include the OS you require, you can download the\nsource and create a custom distribution.\n\n**Requirements**\n\n* go tools installed\n* docker installed\n* source cloned to `$GOPATH/src/github.com/bhoriuchi/terraform-provider-javascript`\n\n**Steps**\n\nThe following will set the build environment and use a docker instance to build the requested\ndistribution packages.\n\n1. cd to `$GOPATH/src/github.com/bhoriuchi/terraform-provider-javascript`\n2. Set the environment variable `GOX_OS_ARCH` to the desired os/architecture combination. See [gox usage](https://github.com/mitchellh/gox#usage)\n3. run `make dist`\n\n### Credits\n\n* Build scripts and project outline copied from [https://github.com/prudhvitella/terraform-provider-infoblox](https://github.com/prudhvitella/terraform-provider-infoblox)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhoriuchi%2Fterraform-provider-javascript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbhoriuchi%2Fterraform-provider-javascript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhoriuchi%2Fterraform-provider-javascript/lists"}