Skip to content

Commit f8a2c9a

Browse files
chore: update README based on other providers
1 parent d5b99d0 commit f8a2c9a

1 file changed

Lines changed: 112 additions & 8 deletions

File tree

README.md

Lines changed: 112 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,52 @@
11
# GraphQL Hive Terraform Provider
22

3+
The Terraform GraphQL Hive provider allows you to configure your [GraphQL Hive](https://graphql-hive.com/) project with infrastructure-as-code principles.
4+
5+
# Commercial support
6+
7+
Need support implementing this terraform provider in your organization? Or are you missing features
8+
that need to be added, then we are able to offer support. Please contact us at opensource@labdigital.nl
9+
10+
# Quick start
11+
12+
[Read our documentation](https://registry.terraform.io/providers/labd/hive/latest/docs)
13+
and check out the examples in the [examples](./examples) directory.
314

415
## Usage
516

6-
```hcl
17+
The provider is distributed via the Terraform registry. To use it you need to configure
18+
the [`required_providers`](https://www.terraform.io/language/providers/requirements#requiring-providers) block. For example:
719

20+
```hcl
821
terraform {
922
required_providers {
1023
hive = {
11-
source = "labd/hive"
12-
version = "0.0.1"
24+
source = "labd/hive"
25+
26+
# It's recommended to pin the version, e.g.:
27+
# version = "~> 1.0.0"
1328
}
1429
}
1530
}
1631
1732
data "hive_schema_check" "my-service" {
1833
project = "my-project"
19-
target = "my-target
34+
target = "my-target"
2035
service = "my-service"
2136
schema = file("schema.graphql")
2237
}
2338
2439
resource "hive_schema_check" "my-service" {
2540
project = "my-project"
26-
target = "my-target
41+
target = "my-target"
2742
service = "my-service"
2843
commit = "57ee05c"
2944
schema = file("schema.graphql")
3045
}
3146
3247
resource "hive_schema_publish" "my-service" {
3348
project = "my-project"
34-
target = "my-target
49+
target = "my-target"
3550
service = "my-service"
3651
commit = "57ee05c"
3752
url = "https://checkout.example.com/graphql"
@@ -40,12 +55,101 @@ resource "hive_schema_publish" "my-service" {
4055
4156
resource "hive_app_create" "persisted_documents" {
4257
name = "site"
43-
version = "1.0.0"
58+
version = "1.0.0"
4459
documents = file("persisted_documents.json")
4560
}
4661
4762
resource "hive_app_publish" "persisted_documents" {
4863
name = "site"
49-
version = "1.0.0"
64+
version = "1.0.0"
65+
}
66+
```
67+
68+
# Binaries
69+
70+
Packages of the releases are available at
71+
https://github.com/labd/terraform-provider-hive/releases See the
72+
[terraform documentation](https://www.terraform.io/docs/configuration/providers.html#third-party-plugins)
73+
for more information about installing third-party providers.
74+
75+
# Contributing
76+
77+
## Requirements
78+
79+
- [Go](https://golang.org/doc/install) >= 1.24
80+
- [Task](https://taskfile.dev/installation/)
81+
- [Changie](https://github.com/miniscruff/changie)
82+
83+
## Building the provider
84+
85+
Clone repository to: `$GOPATH/src/github.com/labd/terraform-provider-hive`
86+
87+
```sh
88+
$ mkdir -p $GOPATH/src/github.com/labd; cd $GOPATH/src/github.com/labd
89+
$ git clone git@github.com:labd/terraform-provider-hive
90+
```
91+
92+
Enter the provider directory and build the provider
93+
94+
```sh
95+
$ cd $GOPATH/src/github.com/labd/terraform-provider-hive
96+
$ task build-local
97+
```
98+
99+
A build is created `terraform-provider-hive_99.0.0` in the root directory and added to plugin folder available
100+
locally:
101+
102+
```sh
103+
~/.terraform.d/plugins/registry.terraform.io/labd/hive/99.0.0/${OS_ARCH}/terraform-provider-hive_v99.0.0
104+
```
105+
106+
Use version `99.0.0` in the provider to test your changes locally
107+
108+
```hcl
109+
terraform {
110+
required_providers {
111+
hive = {
112+
source = "labd/hive"
113+
version = "99.0.0"
114+
}
115+
}
50116
}
51117
```
118+
119+
## Debugging / Troubleshooting
120+
121+
There are two environment settings for troubleshooting:
122+
123+
- `TF_LOG=INFO` enables debug output for Terraform.
124+
- `HIVE_DEBUG=1` enables debug output for the GraphQL Hive GO SDK this provider uses.
125+
126+
Note this generates a lot of output!
127+
128+
## Releasing
129+
130+
When creating a PR with changes, please include a changie file in the `changelogs/unreleased` folder. This file can be
131+
interactively generated by running `changie new` in the root of the project. Pick a suitable category for the change. We
132+
recommend `Fixed` or `Added` for most cases.
133+
134+
Once a new version is released, all the unreleased changelog files will be merged and added to the general CHANGELOG.md file.
135+
136+
## Testing
137+
138+
### Running the unit tests
139+
140+
```sh
141+
$ task test
142+
```
143+
144+
### Running the unit tests with coverage
145+
146+
```sh
147+
$ task coverage
148+
```
149+
150+
## Authors
151+
152+
This project is developed by [Lab Digital](https://www.labdigital.nl). We
153+
welcome additional contributors. Please see our
154+
[GitHub repository](https://github.com/labd/terraform-provider-hive)
155+
for more information.

0 commit comments

Comments
 (0)