Skip to content

mdb/terraform-provider-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-provider-example

A basic Terraform 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; 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

About

An example demo-ing how to create a custom Terraform provider, as well as how to reproduce a presumed Terraform bug

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors