Whilst the Pact Broker has APIs and can be automated, not everything can be configured statically in a config file and it can be time consuming to build your own automation. Furthermore, the lifecycle of use cases on the broker (for example, adding a webhook for a new application) should not require a configuration change and application restart as proposed by issues such as this.
It is common practice to apply infrastructure-as-code practices to both self-hosted and SaaS products alike, and up until now, we lacked this capability.
Introducing Terraform 🚀
Today we announce the release of our Terraform provider v0.0.1. Terraform is a tool that lets you use Infrastructure as Code to provision and manage any cloud, infrastructure, or service.
Terraform allows infrastructure to be expressed as code in a simple, human readable language called HCL (HashiCorp Configuration Language). Here is an example that provisions two Pacticipants (AdminUI and GraphQLAPI), a Webhook for when the contract changes between the systems and an encrypted Jenkins secret:
Before you apply changes, Terraform provides an execution plan of changes, which can be reviewed for safety and then applied and provisioned. Terraform will detect any changes that have been made to the resources remotely and re-apply the configuration to prevent drift.
You can read our documentation on the resources we support here.
The provider is available for download now and supports the following resources:
- API Tokens
As the broker API progresses, we will add support for other items such as
- Certificate management for integrations with internal CA-signed systems
- Integration Whitelists
- SAML and SSO setup
- User and group management
Want to see something else here? Help us prioritise what we do next!