Skip to content

Commit

Permalink
Add other method of local development
Browse files Browse the repository at this point in the history
  • Loading branch information
mitch-hamm committed Feb 21, 2024
1 parent bd19abe commit 5a39193
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,5 @@ gen

temp/**

.vscode/
.vscode/
sa_key.json
33 changes: 33 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,36 @@ If you would like to contribute code to this project, fork the repository and se
| MacOS(amd64) | ~/.terraform.d/plugins/registry.terraform.io/streamnative/streamnative/0.1.0/darwin_amd64/ |

- Run `make build-dev`, it will build the binary and copy it to the plugin directory automatically.

## OR

## Using .terraformrc

- Make sure GOBIN is set (if not set it to `/Users/<Username>/go/bin`)
- Create a file in `~` named `.terraformrc`
- Add the following into the file
```
provider_installation {
dev_overrides {
"terraform.local/local/streamnative" = "/Users/<Username>/go/bin" #Or your GOBIN if it's defined as a different path
}
# For all other providers, install them directly from their origin provider
# registries as normal. If you omit this, Terraform will _only_ use
# the dev_overrides block, and so no other providers will be available.
direct {}
}
```
- Run `go install .` in the provider root
- Use the provider in terraform like so
```
terraform {
required_providers {
streamnative = {
source = "terraform.local/local/streamnative"
}
}
}
```
- Run a terraform plan and terraform should use the newly built copy

0 comments on commit 5a39193

Please sign in to comment.