{"id":18452016,"url":"https://github.com/hashicorp/go-tfe","last_synced_at":"2026-01-08T00:11:38.174Z","repository":{"id":37470230,"uuid":"131622334","full_name":"hashicorp/go-tfe","owner":"hashicorp","description":"HCP Terraform/Enterprise API Client/SDK in Golang","archived":false,"fork":false,"pushed_at":"2025-04-09T16:54:07.000Z","size":3913,"stargazers_count":239,"open_issues_count":23,"forks_count":104,"subscribers_count":277,"default_branch":"main","last_synced_at":"2025-04-13T23:57:31.517Z","etag":null,"topics":["cloud","sdk","terraform-cloud","terraform-enterprise","tfe"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/hashicorp/go-tfe","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hashicorp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":"audit_trail.go","citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-04-30T16:56:47.000Z","updated_at":"2025-04-11T03:42:06.000Z","dependencies_parsed_at":"2023-09-26T20:20:18.630Z","dependency_job_id":"27123f08-63a7-47ab-a13b-365396371874","html_url":"https://github.com/hashicorp/go-tfe","commit_stats":null,"previous_names":[],"tags_count":169,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fgo-tfe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fgo-tfe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fgo-tfe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fgo-tfe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hashicorp","download_url":"https://codeload.github.com/hashicorp/go-tfe/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248799926,"owners_count":21163403,"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":["cloud","sdk","terraform-cloud","terraform-enterprise","tfe"],"created_at":"2024-11-06T07:29:53.407Z","updated_at":"2026-01-08T00:11:38.134Z","avatar_url":"https://github.com/hashicorp.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"HCP Terraform and Terraform Enterprise Go Client\n==============================\n\n[![Tests](https://github.com/hashicorp/go-tfe/actions/workflows/ci.yml/badge.svg)](https://github.com/hashicorp/go-tfe/actions/workflows/ci.yml)\n[![GitHub license](https://img.shields.io/github/license/hashicorp/go-tfe.svg)](https://github.com/hashicorp/go-tfe/blob/main/LICENSE)\n[![GoDoc](https://godoc.org/github.com/hashicorp/go-tfe?status.svg)](https://godoc.org/github.com/hashicorp/go-tfe)\n[![Go Report Card](https://goreportcard.com/badge/github.com/hashicorp/go-tfe)](https://goreportcard.com/report/github.com/hashicorp/go-tfe)\n[![GitHub issues](https://img.shields.io/github/issues/hashicorp/go-tfe.svg)](https://github.com/hashicorp/go-tfe/issues)\n\nThe official Go API client for [HCP Terraform and Terraform Enterprise](https://www.hashicorp.com/products/terraform).\n\nThis client supports the [HCP Terraform V2 API](https://developer.hashicorp.com/terraform/cloud-docs/api-docs).\nAs Terraform Enterprise is a self-hosted distribution of HCP Terraform, this\nclient supports both HCP Terraform and Terraform Enterprise use cases. In all package\ndocumentation and API, the platform will always be stated as 'Terraform\nEnterprise' - but a feature will be explicitly noted as only supported in one or\nthe other, if applicable (rare).\n\n## Version Information\n\nAlmost always, minor version changes will indicate backwards-compatible features and enhancements. Occasionally, function signature changes that reflect a bug fix may appear as a minor version change. Patch version changes will be used for bug fixes, performance improvements, and otherwise unimpactful changes.\n\n## Example Usage\n\nConstruct a new TFE client, then use the various endpoints on the client to\naccess different parts of the Terraform Enterprise API. The following example lists\nall organizations.\n\n### (Recommended Approach) Using custom config to provide configuration details to the API client\n\n```go\nimport (\n  \"context\"\n  \"log\"\n\n  \"github.com/hashicorp/go-tfe\"\n)\n\nconfig := \u0026tfe.Config{\n\tAddress: \"https://tfe.local\",\n\tToken: \"insert-your-token-here\",\n  RetryServerErrors: true,\n}\n\nclient, err := tfe.NewClient(config)\nif err != nil {\n\tlog.Fatal(err)\n}\n\norgs, err := client.Organizations.List(context.Background(), nil)\nif err != nil {\n\tlog.Fatal(err)\n}\n```\n\n### Using the default config with env vars\nThe default configuration makes use of the `TFE_ADDRESS` and `TFE_TOKEN` environment variables.\n\n1. `TFE_ADDRESS` - URL of a HCP Terraform or Terraform Enterprise instance. Example: `https://tfe.local`\n1. `TFE_TOKEN` - An [API token](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/api-tokens) for the HCP Terraform or Terraform Enterprise instance.\n\n**Note:** Alternatively, you can set `TFE_HOSTNAME` which serves as a fallback for `TFE_ADDRESS`. It will only be used if `TFE_ADDRESS` is not set and will resolve the host to an `https` scheme. Example: `tfe.local` =\u003e resolves to `https://tfe.local`\n\nThe environment variables are used as a fallback to configure TFE client if the Address or Token values are not provided as in the cases below:\n\n#### Using the default configuration\n```go\nimport (\n  \"context\"\n  \"log\"\n\n  \"github.com/hashicorp/go-tfe\"\n)\n\n// Passing nil to tfe.NewClient method will also use the default configuration\nclient, err := tfe.NewClient(tfe.DefaultConfig())\nif err != nil {\n\tlog.Fatal(err)\n}\n\norgs, err := client.Organizations.List(context.Background(), nil)\nif err != nil {\n\tlog.Fatal(err)\n}\n```\n\n#### When Address or Token has no value\n```go\nimport (\n  \"context\"\n  \"log\"\n\n  \"github.com/hashicorp/go-tfe\"\n)\n\nconfig := \u0026tfe.Config{\n\tAddress: \"\",\n\tToken: \"\",\n}\n\nclient, err := tfe.NewClient(config)\nif err != nil {\n\tlog.Fatal(err)\n}\n\norgs, err := client.Organizations.List(context.Background(), nil)\nif err != nil {\n\tlog.Fatal(err)\n}\n```\n\n## Documentation\n\nFor complete usage of the API client, see the [full package docs](https://pkg.go.dev/github.com/hashicorp/go-tfe).\n\n## Examples\n\nSee the [examples directory](https://github.com/hashicorp/go-tfe/tree/main/examples).\n\n## Running tests\n\nSee [TESTS.md](docs/TESTS.md).\n\n## Issues and Contributing\n\nSee [CONTRIBUTING.md](docs/CONTRIBUTING.md)\n\n## Releases\n\nSee [RELEASES.md](docs/RELEASES.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashicorp%2Fgo-tfe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhashicorp%2Fgo-tfe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashicorp%2Fgo-tfe/lists"}