The Terraform GraphQL Hive provider allows you to configure your GraphQL Hive project with infrastructure-as-code principles.
Need support implementing this terraform provider in your organization? Or are you missing features that need to be added, then we are able to offer support. Please contact us at opensource@labdigital.nl
Read our documentation and check out the examples in the examples directory.
The provider is distributed via the Terraform registry. To use it you need to configure
the required_providers
block. For example:
terraform {
required_providers {
hive = {
source = "labd/hive"
# It's recommended to pin the version, e.g.:
# version = "~> 1.0.0"
}
}
}
data "hive_schema_check" "my-service" {
project = "my-project"
target = "my-target"
service = "my-service"
schema = file("schema.graphql")
}
resource "hive_schema_check" "my-service" {
project = "my-project"
target = "my-target"
service = "my-service"
commit = "57ee05c"
schema = file("schema.graphql")
}
resource "hive_schema_publish" "my-service" {
project = "my-project"
target = "my-target"
service = "my-service"
commit = "57ee05c"
url = "https://checkout.example.com/graphql"
schema = file("schema.graphql")
}
resource "hive_app_create" "persisted_documents" {
name = "site"
version = "1.0.0"
documents = file("persisted_documents.json")
}
resource "hive_app_publish" "persisted_documents" {
name = "site"
version = "1.0.0"
}
Packages of the releases are available at https://github.com/labd/terraform-provider-hive/releases See the terraform documentation for more information about installing third-party providers.
Clone repository to: $GOPATH/src/github.com/labd/terraform-provider-hive
$ mkdir -p $GOPATH/src/github.com/labd; cd $GOPATH/src/github.com/labd
$ git clone git@github.com:labd/terraform-provider-hive
Enter the provider directory and build the provider
$ cd $GOPATH/src/github.com/labd/terraform-provider-hive
$ task build-local
A build is created terraform-provider-hive_99.0.0
in the root directory and added to plugin folder available
locally:
~/.terraform.d/plugins/registry.terraform.io/labd/hive/99.0.0/${OS_ARCH}/terraform-provider-hive_v99.0.0
Use version 99.0.0
in the provider to test your changes locally
terraform {
required_providers {
hive = {
source = "labd/hive"
version = "99.0.0"
}
}
}
There are two environment settings for troubleshooting:
TF_LOG=INFO
enables debug output for Terraform.HIVE_DEBUG=1
enables debug output for the GraphQL Hive GO SDK this provider uses.
Note this generates a lot of output!
When creating a PR with changes, please include a changie file in the changelogs/unreleased
folder. This file can be
interactively generated by running changie new
in the root of the project. Pick a suitable category for the change. We
recommend Fixed
or Added
for most cases.
Once a new version is released, all the unreleased changelog files will be merged and added to the general CHANGELOG.md file.
$ task test
$ task coverage
This project is developed by Lab Digital. We welcome additional contributors. Please see our GitHub repository for more information.