Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pactflow/terraform-provider-pact
Terraform provider for Pact Broker (and Pactflow)
https://github.com/pactflow/terraform-provider-pact
pact pact-broker pactflow terraform
Last synced: 4 days ago
JSON representation
Terraform provider for Pact Broker (and Pactflow)
- Host: GitHub
- URL: https://github.com/pactflow/terraform-provider-pact
- Owner: pactflow
- License: mit
- Created: 2020-02-10T11:39:49.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-25T09:49:17.000Z (5 months ago)
- Last Synced: 2024-06-26T08:31:35.761Z (5 months ago)
- Topics: pact, pact-broker, pactflow, terraform
- Language: Go
- Homepage: https://pactflow.io
- Size: 10.6 MB
- Stars: 23
- Watchers: 10
- Forks: 4
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Pact Broker - Terraform Provider
Terraform Provider for [Pact Broker](https://github.com/pact-foundation/pact_broker) and [Pactflow](https://pactflow.io).
[![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)
[![Coverage Status](https://coveralls.io/repos/github/pactflow/terraform/badge.svg?branch=master)](https://coveralls.io/github/pactflow/terraform?branch=master)
[![Go Report Card](https://goreportcard.com/badge/github.com/pactflow/terraform)](https://goreportcard.com/report/github.com/pactflow/terraform)
[![GoDoc](https://godoc.org/github.com/pactflow/terraform?status.svg)](https://godoc.org/github.com/pactflow/terraform)
[![slack](http://slack.pact.io/badge.svg)](http://slack.pact.io)## Introduction
Example:
```hcl
terraform {
required_providers {
pact = {
source = "pactflow/pact"
version = "0.1.2" # check the version
}
}
}variable "token" {
type = string
}provider "pact" {
# For the OSS Broker
# host = "http://localhost"
# basic_auth_username = "pact_broker"
# basic_auth_password = "pact_broker"# For a Pactflow Broker
host = "https://mybroker.pact.dius.com.au"
access_token = var.token
}# Create a Pacticipant for our Product API
resource "pact_application" "product_api" {
name = "product_api"
repository_url = "github.com/foo/product_api"
}# Create a Pacticipant for our Ecommerce Website
resource "pact_application" "ecommerce_web" {
name = "ecommerce_web"
repository_url = "github.com/foo/ecommerce_web"
}# Create a secret
resource "pact_secret" "ci_token" {
name = "CIToken"
description = "Jenkins token for Pactflow"
value = "my super secret value"
}# Create a webhook to trigger a build when a contract changes
# Uses the Jenkins token from above
resource "pact_webhook" "product_api_changed" {
description = "Trigger build when a contract changes between ecommerce_web and product_api"
webhook_provider = {
name = "product_api"
}
webhook_consumer = {
name = "ecommerce_web"
}
request {
url = "https://foo.com/some/endpoint"
method = "POST"
headers = {
"Content-Type" = "application/json",
"Authoriation" = "Bearer $${user.CIToken}"
}
body = <