Skip to content

Commit 8c0e50a

Browse files
authored
New development instructions (#317)
1 parent d27f5cd commit 8c0e50a

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

README.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,23 +55,28 @@ Read more at https://www.terraform.io/docs/language/providers/requirements.html
5555

5656
### From source
5757

58-
Clone repository to `$GOPATH/src/github.com/cloudamqp/terraform-provider-cloudamqp`
58+
Clone repository to `/home/USER/code/cloudamqp/terraform-provider-cloudamqp`
5959

60-
Change directory and build the provider from make. This will call `go install` and install the plugin under `$GOPATH/bin`.
60+
Change directory and build the provider binary using `go build`.
6161

62-
```sh
63-
$ cd $GOPATH/src/github.com/cloudamqp/terraform-provider-cloudamqp
64-
$ make build
62+
Setup [.terraformrc](https://developer.hashicorp.com/terraform/cli/config/config-file) so that terraform will use the binary that we just build instead of the one from the registry
63+
64+
```
65+
provider_installation {
66+
dev_overrides {
67+
"hashicorp/cloudamqp" = "/home/USER/code/cloudamqp/terraform-provider-cloudamqp"
68+
}
69+
direct {}
70+
}
6571
```
72+
make sure the path points to where you checked out the code.
6673

67-
Run `terraform init` from the same folder as the tf.file is located. Terraform should also search in `$GOPATH/bin`. If this not the case, the provider needs to be manually installed by moving it to `$HOME/.terraform.d/plugins`. [Install plugins](https://www.terraform.io/docs/plugins/basics.html#installing-plugins). If `$HOME/.terraform.d/plugins` don't exists, the directory needs to be created.
74+
When using `dev_overrides` there is no need to a `terraform init` since you already have the provider locally.
75+
You should also not have the `terraform ... required_provders` block in your `.tf` file
6876

69-
```sh
70-
$ mkdir -p ~/.terraform.d/plugins
71-
$ cp $GOPATH/bin/terraform-provider-cloudamqp $HOME/.terraform.d/plugins/terraform-provider-cloudamqp
72-
$ cd <path_to_tf_file>
73-
$ terraform init
74-
```
77+
When this is setup you can just run `plan` or `apply` and terraform will use your locally compiled binary as provider.
78+
79+
*To change the provider now you can just update the code and hit `go build` and then rerun your terraform command.*
7580

7681
More detailed documentation of the provider can be found at: https://docs.cloudamqp.com/cloudamqp_terraform.html
7782

0 commit comments

Comments
 (0)