No description
  • Go 95.6%
  • HTML 2.5%
  • Shell 1.1%
  • Makefile 0.8%
Find a file
Tomáš Karásek 32bd1e5442
Merge pull request #242 from displague/changelog-3.0.0-update
update 3.0.0 CHANGELOG for BREAKING CHANGES
2020-07-29 15:47:18 +03:00
.github Make CoC and support channels more visible 2017-11-01 23:05:53 +01:00
packet fix acceptance tests for packet_device_network_type 2020-07-20 17:27:20 +02:00
scripts Fix Changelog Links Script for packet provider 2017-06-26 13:59:41 -04:00
vendor include packngo with BGP neighbors 2020-04-29 13:40:18 +02:00
website Change network_mode => network_type in docs 2020-07-21 20:00:33 +02:00
.gitignore Updating Makefile + Add gitignore 2017-06-06 16:29:02 -04:00
.go-version bump hidden go version 2019-10-26 10:56:12 +03:00
.travis.yml Bump Go version to 1.13 2019-10-25 22:40:11 +03:00
CHANGELOG.md update 3.0.0 CHANGELOG for BREAKING CHANGES 2020-07-28 10:07:38 -04:00
GNUmakefile Remove govendor references 2019-02-14 21:07:21 +00:00
go.mod include packngo with BGP neighbors 2020-04-29 13:40:18 +02:00
go.sum include packngo with BGP neighbors 2020-04-29 13:40:18 +02:00
LICENSE initial commit 2017-06-05 20:54:10 +00:00
main.go Terraform Plugin SDK migration 2019-09-27 15:20:34 +03:00
README.md Bump Go version to 1.13 2019-10-25 22:40:11 +03:00

Terraform Provider

Requirements

  • Terraform 0.10.x
  • Go 1.13 (to build the provider plugin)

Building the provider

Clone repository to: $GOPATH/src/github.com/terraform-providers/terraform-provider-packet

$ mkdir -p $GOPATH/src/github.com/terraform-providers; cd $GOPATH/src/github.com/terraform-providers
$ git clone git@github.com:terraform-providers/terraform-provider-packet

Enter the provider directory and build the provider

$ cd $GOPATH/src/github.com/terraform-providers/terraform-provider-packet
$ make build

Using the provider

The packet provider will be installed on terraform init of a template using any of the packet_* resources.

Available resource and datasources are documented at https://www.terraform.io/docs/providers/packet/index.html.

Developing the provider

If you wish to work on the provider, you'll first need Go installed on your machine (version 1.13+ is required). You'll also need to correctly setup a GOPATH, as well as adding $GOPATH/bin to your $PATH.

To compile the provider, run make build. This will build the provider and put the provider binary in the $GOPATH/bin directory.

$ make bin
...
$ $GOPATH/bin/terraform-provider-packet
...

Testing provider code

We have mostly acceptance tests in the provider. There's no point for you to run them all, but you should run the one covering the functionality which you change. The acceptance test run will cost you some money, so feel free to abstain. The acceptance test suite will be run for your PR during the review process.

To run an acceptance test, find the relevant test function in *_test.go (for example TestAccPacketDevice_Basic), and run it as

TF_ACC=1 go test -v -timeout=20m -run=TestAccPacketDevice_Basic

If you want to see HTTP traffic, set TF_LOG=DEBUG, i.e.

TF_LOG=DEBUG TF_ACC=1 go test -v -timeout=20m -run=TestAccPacketDevice_Basic

Testing the provider with Terraform

Once you've built the plugin binary (see Developing the provider above), it can be incorporated within your Terraform environment using the -plugin-dir option. Subsequent runs of Terraform will then use the plugin from your development environment.

$ terraform init -plugin-dir $GOPATH/bin