Skip to content

Commit ed30ba3

Browse files
committed
Add development instructions
Signed-off-by: Danny Kopping <[email protected]>
1 parent f5dc37c commit ed30ba3

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

README.md

+36-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,38 @@
11
# terraform-provider-coder
22

3-
See [Coder](https://github.com/coder/coder).
3+
Terraform provider for [Coder](https://github.com/coder/coder).
4+
5+
### Developing
6+
7+
Follow the instructions outlined in the [Terraform documentation](https://developer.hashicorp.com/terraform/cli/config/config-file#development-overrides-for-provider-developers)
8+
to setup your local Terraform to use your local version rather than the registry version.
9+
10+
1. Create a file named `.terraformrc` in your `$HOME` directory
11+
2. Add the following content:
12+
```hcl
13+
provider_installation {
14+
# Override the coder/coder provider to use your local version
15+
dev_overrides {
16+
"coder/coder" = "/path/to/terraform-provider-coder"
17+
}
18+
19+
# For all other providers, install them directly from their origin provider
20+
# registries as normal. If you omit this, Terraform will _only_ use
21+
# the dev_overrides block, and so no other providers will be available.
22+
direct {}
23+
}
24+
```
25+
3. (optional, but recommended) Validate your configuration:
26+
1. Create a new `main.tf` file and include:
27+
```hcl
28+
terraform {
29+
required_providers {
30+
coder = {
31+
source = "coder/coder"
32+
}
33+
}
34+
}
35+
```
36+
2. Run `terraform init` and observe a warning like `Warning: Provider development overrides are in effect`
37+
4. Run `go build -o terraform-provider-coder` to build the provider binary, which Terraform will try locate and execute
38+
5. All local Terraform runs will now use your local provider!

0 commit comments

Comments
 (0)