{"id":21261380,"url":"https://github.com/dflook/tofu-remote-state","last_synced_at":"2026-03-19T19:31:22.618Z","repository":{"id":204303029,"uuid":"708927356","full_name":"dflook/tofu-remote-state","owner":"dflook","description":"  GitHub action to get outputs from an OpenTofu remote state ","archived":false,"fork":false,"pushed_at":"2026-01-13T13:53:26.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-13T16:35:34.795Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":false,"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/dflook.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["dflook"]}},"created_at":"2023-10-23T17:00:53.000Z","updated_at":"2026-01-13T13:53:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"d162f798-5acb-4ba8-adcc-73f3fcaa6a59","html_url":"https://github.com/dflook/tofu-remote-state","commit_stats":null,"previous_names":["dflook/tofu-remote-state"],"tags_count":126,"template":false,"template_full_name":null,"purl":"pkg:github/dflook/tofu-remote-state","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflook%2Ftofu-remote-state","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflook%2Ftofu-remote-state/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflook%2Ftofu-remote-state/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflook%2Ftofu-remote-state/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dflook","download_url":"https://codeload.github.com/dflook/tofu-remote-state/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflook%2Ftofu-remote-state/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28482209,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: 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":"2024-11-21T04:29:21.804Z","updated_at":"2026-01-16T20:00:27.002Z","avatar_url":"https://github.com/dflook.png","language":null,"funding_links":["https://github.com/sponsors/dflook"],"categories":[],"sub_categories":[],"readme":"# tofu-remote-state action\n\nThis is one of a suite of OpenTofu related actions - find them at [dflook/terraform-github-actions](https://github.com/dflook/terraform-github-actions).\n\nRetrieves the root-level outputs from an OpenTofu remote state.\n\n## Inputs\n\n* `backend_type`\n\n  The name of the OpenTofu plugin used for backend state\n\n  - Type: string\n  - Required\n\n* `workspace`\n\n  OpenTofu workspace to get the outputs for\n\n  - Type: string\n  - Optional\n  - Default: `default`\n\n* `backend_config`\n\n  List of OpenTofu backend config values, one per line.\n\n  ```yaml\n  with:\n    backend_config: token=${{ secrets.BACKEND_TOKEN }}\n  ```\n\n  - Type: string\n  - Optional\n\n* `backend_config_file`\n\n  List of OpenTofu backend config files to use, one per line.\n  Paths should be relative to the GitHub Actions workspace\n\n  ```yaml\n  with:\n    backend_config_file: prod.backend.tfvars\n  ```\n\n  - Type: string\n  - Optional\n\n## Outputs\n\n* `json_output_path`\n\n  This is the path to all the root module outputs in a JSON file.\n  The path is relative to the Actions workspace.\n\n  For example, with the OpenTofu config:\n\n  ```hcl\n  output \"service_hostname\" {\n    value = \"example.com\"\n  }\n  ```\n\n  The file pointed to by this output will contain:\n\n  ```json\n  {\n    \"service_hostname\": \"example.com\"\n  }\n  ```\n\n  OpenTofu list, set and tuple types are cast to a JSON array, map and object types are cast to a JSON object.\n\n  - Type: string\n\n* OpenTofu Outputs\n\n  An action output will be created for each output of the OpenTofu configuration.\n\n  For example, with the OpenTofu config:\n\n  ```hcl\n  output \"service_hostname\" {\n    value = \"example.com\"\n  }\n  ```\n\n  Running this action will produce a `service_hostname` output with the value `example.com`.\n\n  ### Primitive types (string, number, bool)\n\n  The values for these types get cast to a string with boolean values being 'true' and 'false'.\n\n  ### Complex types (list/set/tuple \u0026 map/object)\n\n  The values for complex types are output as a JSON string. OpenTofu `list`, `set` \u0026 `tuple` types are cast to a JSON array, `map` and `object` types are cast to a JSON object.\n\n  These values can be used in a workflow expression by using the [fromJSON](https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#fromjson) function\n\n## Environment Variables\n\n* `GITHUB_DOT_COM_TOKEN`\n\n  This is used to specify a token for GitHub.com when the action is running on a GitHub Enterprise instance.\n  This is only used for downloading OpenTofu binaries from GitHub.com.\n  If this is not set, an unauthenticated request will be made to GitHub.com to download the binary, which may be rate limited.\n\n  - Type: string\n  - Optional\n\n* `TERRAFORM_CLOUD_TOKENS`\n\n  API token for cloud hosts, of the form `\u003chost\u003e=\u003ctoken\u003e`. This will be used if the backed type is `remote`.\n\n  e.g:\n\n  ```yaml\n  env:\n    TERRAFORM_CLOUD_TOKENS: app.terraform.io=${{ secrets.TF_CLOUD_TOKEN }}\n  ```\n\n  With other registries:\n\n  ```yaml\n  env:\n    TERRAFORM_CLOUD_TOKENS: |\n      app.terraform.io=${{ secrets.TF_CLOUD_TOKEN }}\n      tofu.example.com=${{ secrets.TF_REGISTRY_TOKEN }}\n  ```\n\n  - Type: string\n  - Optional\n\n## Example usage\n\nThis example sends a request to a url that has previously been provisioned by OpenTofu, by fetching the url from the remote state in S3.\n\n```yaml\nname: Send request\n\non:\n  push:\n    branches:\n      - main\n\nenv:\n  AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}\n  AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n\njobs:\n  get_remote_state:\n    runs-on: ubuntu-latest\n    name: Run Test\n    steps:\n      - name: Get remote state\n        uses: dflook/tofu-remote-state@v2\n        id: remote-state\n        with:\n          backend_type: s3\n          backend_config: |\n            bucket=tofu-github-actions\n            key=tofu-remote-state\n            region=eu-west-2\n\n      - name: Send request\n        run: |\n          curl \"${{ steps.remote-state.outputs.url }}\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdflook%2Ftofu-remote-state","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdflook%2Ftofu-remote-state","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdflook%2Ftofu-remote-state/lists"}