{"id":14970178,"url":"https://github.com/hashicorp/terraform-provider-boundary","last_synced_at":"2025-04-04T09:08:16.933Z","repository":{"id":37800817,"uuid":"264053482","full_name":"hashicorp/terraform-provider-boundary","owner":"hashicorp","description":"Manage Boundary's identity-based access controls for resources provisioned with Terraform. This provider is maintained internally by the HashiCorp Boundary team.","archived":false,"fork":false,"pushed_at":"2025-03-21T23:04:32.000Z","size":10878,"stargazers_count":101,"open_issues_count":26,"forks_count":55,"subscribers_count":120,"default_branch":"main","last_synced_at":"2025-03-28T08:06:44.832Z","etag":null,"topics":["boundary","hacktoberfest","hashicorp-boundary","terraform-provider"],"latest_commit_sha":null,"homepage":"https://registry.terraform.io/providers/hashicorp/boundary/latest","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":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-15T00:06:21.000Z","updated_at":"2025-03-21T23:04:34.000Z","dependencies_parsed_at":"2024-04-01T14:57:35.283Z","dependency_job_id":"74f0a5c8-bdc0-4902-b9ed-980e259e8e15","html_url":"https://github.com/hashicorp/terraform-provider-boundary","commit_stats":{"total_commits":438,"total_committers":49,"mean_commits":8.938775510204081,"dds":0.769406392694064,"last_synced_commit":"ce487f406fae7d562ba02f486d13b47d27b8eaf0"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":"hashicorp/terraform-provider-scaffolding","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fterraform-provider-boundary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fterraform-provider-boundary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fterraform-provider-boundary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fterraform-provider-boundary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hashicorp","download_url":"https://codeload.github.com/hashicorp/terraform-provider-boundary/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247149501,"owners_count":20891954,"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":["boundary","hacktoberfest","hashicorp-boundary","terraform-provider"],"created_at":"2024-09-24T13:43:13.916Z","updated_at":"2025-04-04T09:08:16.914Z","avatar_url":"https://github.com/hashicorp.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](boundary.png)\n\n# Terraform Provider Boundary\n\nAvailable in the [Terraform Registry](https://registry.terraform.io/providers/hashicorp/boundary/latest).\n\n## Requirements\n\n-\t[Terraform](https://www.terraform.io/downloads.html) \u003e= 0.13.x\n-\t[Go](https://golang.org/doc/install) \u003e= 1.21\n\n## Building The Provider\n\n1. Clone the repository\n1. Enter the repository directory\n1. Build the provider using `make dev`. This will place the provider onto your system in a [Terraform 0.13-compliant](https://www.terraform.io/upgrade-guides/0-13.html#in-house-providers) manner.\n\nYou'll need to ensure that your Terraform file contains the information necessary to find the plugin when running `terraform init`. `make dev` will use a version number of 0.0.1, so the following block will work:\n\n```hcl\nterraform {\n  required_providers {\n    boundary = {\n      source = \"localhost/providers/boundary\"\n      version = \"0.0.1\"\n    }\n  }\n}\n```\n\n## Adding Dependencies\n\nThis provider uses [Go modules](https://github.com/golang/go/wiki/Modules).\nPlease see the Go documentation for the most up to date information about using Go modules.\n\nTo add a new dependency `github.com/author/dependency` to your Terraform provider:\n\n```shell\ngo get github.com/author/dependency\ngo mod tidy\n```\n\nThen commit the changes to `go.mod` and `go.sum`.\n\n## Developing the Provider\n\nIf you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (see [Requirements](#requirements) above).\n\nTo compile the provider, run `go install`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.\n\nIn order to run the full suite of Acceptance tests,\na postgres docker container must be started first:\n\n```sh\n$ go mod download # ensure boundary is installed, files are used by the docker image\n$ make test-database-up\n```\n\nOnce the test database is ready the tests can be run using `make testacc`.\n\n*Note:* Acceptance tests create real resources, and often cost money to run.\n\n```sh\n$ make testacc\n```\n\nFor more details on the docker image and troubleshooting see the\n[boundary testing doc](https://github.com/hashicorp/boundary/blob/main/CONTRIBUTING.md#testing).\n\n## Debugging the provider\n\nIf you're using vscode, this provider has delve debugging baked into the [.vscode](https://github.com/hashicorp/terraform-provider-boundary/tree/main/.vscode) directory. To debug you can find instructions [here.](https://dev.to/drewmullen/vscode-terraform-provider-development-setup-debugging-6bn#usage)\n\n## Generating Docs\n\nThis provider uses the [terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs/) tool to generate documentation. Each resource and data source requires a set of examples [examples](https://github.com/hashicorp/terraform-provider-boundary/tree/main/examples) then you execute a binary to generate the docs which are placed in [./docs](https://github.com/hashicorp/terraform-provider-boundary/tree/main/docs). Optionally, you can specify your own [templates](https://github.com/hashicorp/terraform-provider-boundary/tree/main/templates) for a resource or data source if you want to add custom information (example: [data \"boundary_scope\"](https://github.com/hashicorp/terraform-provider-boundary/blob/main/templates/data-sources/scope.md.tmpl#L11))\n\n### New Resources \u0026 Data Sources (documentation templates)\n\nIf you're adding a new resource or a data source, you must include a documentation template for your new R/DS in [./templates](https://github.com/hashicorp/terraform-provider-boundary/tree/main/templates) directory. This provider uses the [terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs/) tool to generate documentation. For full details see the link.\n\n### Documentation Examples for Resources \u0026 Data Sources\n\nExamples are required for all resources and data sources. This provider uses the [terraform-plugin-docs](https://github.com/hashicorp/terraform-plugin-docs/) tool to generate documentation. To add examples, add a new file to the [./examples](https://github.com/hashicorp/terraform-provider-boundary/tree/main/examples) directory or update the existing files. Next make sure the corresponding template in [./templates](https://github.com/hashicorp/terraform-provider-boundary/tree/main/templates) directory references this example.\n\n### Generating\n\nFrom the root of the repo run:\n\n```shell\ngo run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs\n```\n\n## Using the provider\n\nPlease see our detailed docs for individual resource usage. Below is a complex example using the Boundary provider to configure all resource types available:\n\n```hcl\nprovider \"boundary\" {\n  addr                   = \"http://127.0.0.1:9200\"\n  auth_method_id         = \"ampw_1234567890\"      # changeme\n  auth_method_login_name = \"myuser\"               # changeme\n  auth_method_password   = \"passpass\"             # changeme\n}\n\nvariable \"users\" {\n  type    = set(string)\n  default = [\n    \"Jim\",\n    \"Mike\",\n    \"Todd\",\n    \"Jeff\",\n    \"Randy\",\n    \"Susmitha\"\n  ]\n}\n\nvariable \"readonly_users\" {\n  type    = set(string)\n  default = [\n    \"Jeff\",\n    \"Pete\",\n    \"JT\"\n  ]\n}\n\nvariable \"backend_server_ips\" {\n  type    = set(string)\n  default = [\n    \"10.1.0.1\",\n    \"10.1.0.2\",\n  ]\n}\n\nresource \"boundary_scope\" \"global\" {\n  global_scope = true\n  scope_id     = \"global\"\n}\n\nresource \"boundary_scope\" \"corp\" {\n  scope_id                 = boundary_scope.global.id\n  auto_create_admin_role   = true\n  auto_create_default_role = true\n}\n\nresource \"boundary_user\" \"users\" {\n  for_each    = var.users\n  name        = each.key\n  description = \"User resource for ${each.key}\"\n  scope_id    = boundary_scope.corp.id\n}\n\n// organization level group for readonly users\nresource \"boundary_group\" \"readonly\" {\n  name        = \"readonly\"\n  description = \"Organization group for readonly users\"\n  member_ids  = [for user in boundary_user.readonly_users : user.id]\n  scope_id    = boundary_scope.corp.id\n}\n\n// add org-level role for readonly access\nresource \"boundary_role\" \"organization_readonly\" {\n  name        = \"readonly\"\n  description = \"Read-only role\"\n  principal_ids = [boundary_group.readonly_users.id]\n  grant_strings = [\"ids=*;type=*;actions=read\"]\n  scope_id    = boundary_scope.corp.id\n}\n\n// add org-level role for administration access\nresource \"boundary_role\" \"organization_admin\" {\n  name        = \"admin\"\n  description = \"Administrator role\"\n  principal_ids = concat(\n    [for user in boundary_user.user: user.id]\n  )\n  grant_strings   = [\"ids=*;type=*;actions=create,read,update,delete\"]\n  scope_id = boundary_scope.corp.id\n}\n\n// create a project for core infrastructure\nresource \"boundary_scope\" \"core_infra\" {\n  description              = \"Core infrastrcture\"\n  scope_id                 = boundary_scope.corp.id\n  auto_create_admin_role   = true\n}\n\nresource \"boundary_host_catalog\" \"backend_servers\" {\n  name        = \"backend_servers\"\n  description = \"Backend servers host catalog\"\n  type        = \"static\"\n  scope_id    = boundary_scope.core_infra.id\n}\n\nresource \"boundary_host\" \"backend_servers\" {\n  for_each        = var.backend_server_ips\n  type            = \"static\"\n  name            = \"backend_server_service_${each.value}\"\n  description     = \"Backend server host\"\n  address         = \"${each.key}\"\n  host_catalog_id = boundary_host_catalog.backend_servers.id\n}\n\nresource \"boundary_host_set\" \"backend_servers_ssh\" {\n  type            = \"static\"\n  name            = \"backend_servers_ssh\"\n  description     = \"Host set for backend servers\"\n  host_catalog_id = boundary_host_catalog.backend_servers.id\n  host_ids        = [for host in boundary_host.backend_servers : host.id]\n}\n\n// create target for accessing backend servers on port :8000\nresource \"boundary_target\" \"backend_servers_service\" {\n  type         = \"tcp\"\n  name         = \"backend_servers_service\"\n  description  = \"Backend service target\"\n  scope_id     = boundary_scope.core_infra.id\n  default_port = \"8080\"\n\n  host_set_ids = [\n    boundary_host_set.backend_servers.id\n  ]\n}\n\n// create target for accessing backend servers on port :22\nresource \"boundary_target\" \"backend_servers_ssh\" {\n  type         = \"tcp\"\n  name         = \"backend_servers_ssh\"\n  description  = \"Backend SSH target\"\n  scope_id     = boundary_scope.core_infra.id\n  default_port = \"22\"\n\n  host_set_ids = [\n    boundary_host_set.backend_servers_ssh.id\n  ]\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashicorp%2Fterraform-provider-boundary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhashicorp%2Fterraform-provider-boundary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashicorp%2Fterraform-provider-boundary/lists"}