{"id":20468489,"url":"https://github.com/pactflow/terraform-provider-pact","last_synced_at":"2025-04-13T10:25:23.815Z","repository":{"id":41264715,"uuid":"239497730","full_name":"pactflow/terraform-provider-pact","owner":"pactflow","description":"Terraform provider for Pact Broker (and Pactflow)","archived":false,"fork":false,"pushed_at":"2025-03-13T01:46:13.000Z","size":12170,"stargazers_count":24,"open_issues_count":7,"forks_count":4,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-27T01:47:54.481Z","etag":null,"topics":["pact","pact-broker","pactflow","terraform"],"latest_commit_sha":null,"homepage":"https://pactflow.io","language":"Go","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/pactflow.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"open_collective":"pact-foundation","custom":["https://pactflow.io"]}},"created_at":"2020-02-10T11:39:49.000Z","updated_at":"2025-02-06T07:28:20.000Z","dependencies_parsed_at":"2023-11-30T05:25:09.435Z","dependency_job_id":"f854f62c-9d8f-4cad-9cfb-bb54c829dc21","html_url":"https://github.com/pactflow/terraform-provider-pact","commit_stats":null,"previous_names":["pactflow/terraform"],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pactflow%2Fterraform-provider-pact","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pactflow%2Fterraform-provider-pact/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pactflow%2Fterraform-provider-pact/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pactflow%2Fterraform-provider-pact/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pactflow","download_url":"https://codeload.github.com/pactflow/terraform-provider-pact/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248696907,"owners_count":21147215,"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":["pact","pact-broker","pactflow","terraform"],"created_at":"2024-11-15T14:05:41.416Z","updated_at":"2025-04-13T10:25:23.787Z","avatar_url":"https://github.com/pactflow.png","language":"Go","funding_links":["https://opencollective.com/pact-foundation","https://pactflow.io"],"categories":[],"sub_categories":[],"readme":"# Pact Broker - Terraform Provider\n\nTerraform Provider for [Pact Broker](https://github.com/pact-foundation/pact_broker) and [Pactflow](https://pactflow.io).\n\n[![Build Status](https://github.com/pactflow/terraform-provider-pact/actions/workflows/test.yml/badge.svg)](https://github.com/pactflow/terraform-provider-pact/actions/workflows/test.yml)\n[![Coverage Status](https://coveralls.io/repos/github/pactflow/terraform/badge.svg?branch=master)](https://coveralls.io/github/pactflow/terraform?branch=master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/pactflow/terraform)](https://goreportcard.com/report/github.com/pactflow/terraform)\n[![GoDoc](https://godoc.org/github.com/pactflow/terraform?status.svg)](https://godoc.org/github.com/pactflow/terraform)\n[![slack](http://slack.pact.io/badge.svg)](http://slack.pact.io)\n\n## Introduction\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"880\" src=\"https://raw.githubusercontent.com/pactflow/terraform/master/examples/tf-run.svg?sanitize=true\"\u003e\n\u003c/p\u003e\n\nExample:\n\n```hcl\nterraform {\n  required_providers {\n    pact = {\n      source = \"pactflow/pact\"\n      version = \"0.1.2\" # check the version\n    }\n  }\n}\n\nvariable \"token\" {\n  type = string\n}\n\nprovider \"pact\" {\n  # For the OSS Broker\n  # host = \"http://localhost\"\n  # basic_auth_username = \"pact_broker\"\n  # basic_auth_password = \"pact_broker\"\n\n  # For a Pactflow Broker\n  host = \"https://mybroker.pact.dius.com.au\"\n  access_token = var.token\n}\n\n# Create a Pacticipant for our Product API\nresource \"pact_application\" \"product_api\" {\n  name = \"product_api\"\n  repository_url = \"github.com/foo/product_api\"\n}\n\n# Create a Pacticipant for our Ecommerce Website\nresource \"pact_application\" \"ecommerce_web\" {\n  name = \"ecommerce_web\"\n  repository_url = \"github.com/foo/ecommerce_web\"\n}\n\n# Create a secret\nresource \"pact_secret\" \"ci_token\" {\n  name = \"CIToken\"\n  description = \"Jenkins token for Pactflow\"\n  value = \"my super secret value\"\n}\n\n# Create a webhook to trigger a build when a contract changes\n# Uses the Jenkins token from above\nresource \"pact_webhook\" \"product_api_changed\" {\n  description = \"Trigger build when a contract changes between ecommerce_web and product_api\"\n  webhook_provider = {\n    name = \"product_api\"\n  }\n  webhook_consumer = {\n    name = \"ecommerce_web\"\n  }\n  request {\n    url = \"https://foo.com/some/endpoint\"\n    method = \"POST\"\n    headers = {\n      \"Content-Type\" = \"application/json\",\n      \"Authoriation\" = \"Bearer $${user.CIToken}\"\n    }\n    body = \u003c\u003cEOF\n{\n  \"pact\": \"$${pactbroker.pactUrl}\"\n}\nEOF\n  }\n\n  events = [\"contract_content_changed\", \"contract_published\"]\n  depends_on = [pact_application.product_api, pact_application.ecommerce_web, pact_secret.ci_token]\n}\n\n# Create a user\nresource \"pact_user\" \"somebody\" {\n  name = \"Tester McPerson\"\n  email = \"pact@dius.com.au\"\n  active = true\n}\n\n# Assign admin role to user\nresource \"pact_role\" \"somebody_admin\" {\n  role = \"administrator\"\n  user = pact_user.somebody.uuid\n}\n\n# Enable authentication via Github and Google\n# NOTE: This only applies to customers on the legacy (Cognito)\n#       authentication. see https://docs.pactflow.io/docs/authentication/main/\nresource \"pact_authentication\" \"authentication\" {\n  github_organizations = [\"pactflow\"]\n  google_domains = [\"pactflow.io\"]\n}\n```\n\n## Installing\n\nDownload the latest [release](https://github.com/pactflow/terraform/releases) and install into your Terraform plugin directory.\n\n### Linux or Mac OSX\n\nRun the following to have the provider installed for you automatically:\n\n```sh\ncurl -fsSL https://raw.githubusercontent.com/pactflow/terraform/master/scripts/install.sh | bash\n```\n\n### Windows\n\nDowload the plugin to `%APPDATA%\\terraform.d\\plugins`.\n\n### Installation notes\n\nThe pact provider is published to the Terraform module registry and may be installed via the standard mechanisms. See the documentation at https://registry.terraform.io/providers/pactflow/pact/latest.\n\n## Using the plugin\n\nhttps://registry.terraform.io/providers/pactflow/pact/latest\n\n| Plugin                                                      | Type     | Platform Support       | Description                                                     |\n| ----------------------------------------------------------- | -------- | ---------------------- | --------------------------------------------------------------- |\n| [Pact](docs/index.md)                                       | Provider | Pact Broker + Pactflow | Configures a target Pact Broker (such as a pactflow.io account) |\n| [Pacticipant](docs/resources/pacticipant.md)                | Resource | Pact Broker + Pactflow | Create applications (known as Pacticipants)                     |\n| [Webhook](docs/resources/webhook.md)                        | Resource | Pact Broker + Pactflow | Configures a webhook to trigger on certain platform events      |\n| [Secret](docs/resources/secret.md)                          | Resource | Pactflow              | Create an encrypted secret for use in Webhooks                  |\n| [API Token](docs/resources/token.md)                        | Resource | Pactflow               | Manage Pactflow API Tokens                                      |\n| [Users](docs/resources/user.md)                             | Resource | Pactflow (cloud only)               | Manage Pactflow Users                                           |\n| [Roles](docs/resources/role.md)                             | Resource | Pactflow               | Manage Pactflow Roles                                           |\n| [Teams](docs/resources/team.md)                             | Resource | Pactflow               | Manage Pactflow Teams                                           |\n| [Environments](docs/resources/environment.md)               | Resource | Pact Broker + Pactflow | Manage Environments                                             |\n| [Authentication Settings](docs/resources/authentication.md) | Resource | Pactflow (cloud only)              | Manage Pactflow Authentication (Github, Google etc.)            |\n\nSee our [Docs](./docs) folder for all plugins.\n\n## Importing Resources\n\nAll resources (except for Roles) support [importing](https://www.terraform.io/docs/import/usage.html).\n\n## Developing\n\n### Requirements\n\n- [Terraform](https://www.terraform.io/downloads.html) 0.10+\n- [Go](https://golang.org/doc/install) (See [build version](.github/workflows/test.yml))\n\n### Building locally\n\n_Note:_ This project uses [Go Modules](https://blog.golang.org/using-go-modules) making it safe to work with it outside of your existing [GOPATH](http://golang.org/doc/code.html#GOPATH). The instructions that follow assume a directory in your home directory outside of the standard GOPATH (e.g. `$HOME/development/terraform-providers/`).\n\nTo compile the provider, run `make build`. This will build the provider and put the provider binary in the `./bin` directory.\n\n```sh\n$ make build\n...\n$ $GOPATH/bin/terraform-provider-aws\n...\n```\n\n## Roadmap\n\nPlan for the next few months:\n\n- [x] Pacticipants\n- [x] Webhooks\n- [x] Secrets (Pactflow only)\n- [x] Users (Pactflow only)\n- [x] Teams (Pactflow only)\n- [x] Assign users to teams (Pactflow only)\n- [x] System Users (Pactflow only)\n- [x] Custom role creation (Pactflow only)\n- [x] Role assignment (Pactflow only)\n- [x] Better error messages for HTTP / runtime failures\n- [x] Acceptance tests\n- [x] Pact tests\n- [ ] Better code coverage\n- [ ] Extract `Client` into separate SDK package\n- [ ] Publish 1.0.0\n\nWant to see something else here? Have you say on our [Pact Feature Request](https://pact.canny.io/feature-requests/p/create-a-terraform-provider) board.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpactflow%2Fterraform-provider-pact","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpactflow%2Fterraform-provider-pact","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpactflow%2Fterraform-provider-pact/lists"}