https://github.com/mdb/terraform-provider-example
An example demo-ing how to create a custom Terraform provider, as well as how to reproduce a presumed Terraform bug
https://github.com/mdb/terraform-provider-example
Last synced: 5 months ago
JSON representation
An example demo-ing how to create a custom Terraform provider, as well as how to reproduce a presumed Terraform bug
- Host: GitHub
- URL: https://github.com/mdb/terraform-provider-example
- Owner: mdb
- Created: 2016-05-06T13:30:30.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-05-06T14:52:23.000Z (about 10 years ago)
- Last Synced: 2025-02-03T14:49:34.440Z (over 1 year ago)
- Language: Go
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# terraform-provider-example
A basic [Terraform](http://terraform.io) provider example.
This repo also seeks to illustrate a feature opportunity within Terraform
wherein a provider resource with a `connection` key of type `TypeList` seemingly yields
in misleading error message, as [`connection` is a reserved word](https://www.terraform.io/docs/provisioners/connection.html);
the key must be named something other than `connection`. In such a scenario,
error output other than `"connection": required field is not set` could be helpful.
## To observe the bug
```
# clone the repo to your $GOPATH:
git clone https://github.com/mdb/terraform-provider-example
# activate the provider by adding the following to `~/.terraformrc`
providers {
"example" = "/YOUR_GOPATH/bin/terraform-provider-example"
}
# install the example provider
cd terraform-provider-example
make install
# observe that the following outputs an error:
# * example_thing.test_thing: "connection": required field is not set
terraform plan
```
To observe that changing the key name to something other than `connection` --
in this case `thing_connection` -- works as expected:
```
# check out the `works` branch
git checkout works
# install the example provider
cd terraform-provider-example
make install
# observe that the following works as expected:
terraform plan
```