No description
  • Go 90.8%
  • HCL 5.7%
  • HTML 1.4%
  • Makefile 1.3%
  • Shell 0.8%
Find a file
2020-08-14 15:51:16 +00:00
.github Remove Dave from code owners 2020-03-13 15:41:25 -04:00
examples [PE-1694] Google Router and Interconnects need unique names (#62) 2019-10-23 16:47:30 -04:00
pureport adds support for customer_asn to pureport_aws_connection 2020-08-13 16:45:08 -04:00
scripts Add initial Resource and Data Source stubs 2019-04-15 13:54:16 -04:00
test-infr Fix the Terraform 0.12 deprecation warnings 2020-01-27 09:59:36 -05:00
vendor Maintainance Updates 2020-02-27 12:45:31 -05:00
version Add version package 2019-04-02 16:24:38 -04:00
website adds support for customer_asn to pureport_aws_connection 2020-08-13 16:45:08 -04:00
.gitignore Ignore developer artifacts 2019-10-23 15:05:03 -04:00
.golangci.yml Fix linter ignore to match new terraform-plugin-sdk 2019-11-18 16:00:18 -05:00
.travis.yml Increase Travis timeout for running Code Lint 2020-08-14 08:46:10 -04:00
CHANGELOG.md Cleanup after v1.1.9 release 2020-08-14 15:51:16 +00:00
GNUmakefile Update plugin name to match Terraform format 2019-11-18 09:12:11 -05:00
go.mod Maintainance Updates 2020-02-27 12:45:31 -05:00
go.sum Maintainance Updates 2020-02-27 12:45:31 -05:00
Jenkinsfile Bump version number 2020-08-14 08:48:52 -04:00
LICENSE Initial commit 2019-03-15 12:52:34 -04:00
main.go Add the Terraform Plugin SDK 2019-11-18 10:42:09 -05:00
README.md Additional updates for golang 1.13 (#59) 2019-09-23 16:03:46 -04:00
staticcheck.conf Add initial code stubs 2019-04-02 16:36:38 -04:00
tools.go Tools need to be vendored 2019-10-24 15:31:19 -04:00

Terraform Provider

Maintainers

This provider plugin is maintained by the Pureport Inc, team at Pureport.

Requirements

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

Usage

# For example, restrict pureport version in 1.1.2
provider "pureport" {
  version = "~> 1.1.2"
}

Building The Provider

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

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

Enter the provider directory and build the provider

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

Using the provider

3rd Party plugin installation

Copy the terraform-provider-pureport plugin in to the terraform third-party plugins directory.

OS Location
Windows %APPDATA%\terraform.d\plugins
All other systems ~/.terraform.d/plugins

More information about this can be found here.

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 build
...
$ $GOPATH/bin/terraform-provider-pureport
...

This provider uses golangci-lint for checking static analysis of the source code. This needs to be installed separate from the other golang modules required to build the provider.

$ make tools
$ make lint

In order to test the provider, you can simply run make test.

$ make test

In order to run the full suite of Acceptance tests, run make testacc.

Note: Acceptance tests create real resources, and often cost money to run.

$ make testacc

You can also install the plugin which will build and copy the plugin to your terraform third party plugin directory. You'll need to re-initialize terraform in module directory after installing the new plugin.

$ make install
$ cd <some_module>/
$ terraform init

Acceptance Test Setup

When preparing to run the acceptance tests, some initial manual setup will be required for each cloud provider to ensure we are able to deploy the cloud infrastructure for testing.

An example environment setup script is available in this repository in examples/envsetup.sh.examples. You can modify this file with your cloud provider information and then source it in to your shell prior to deploying and running the acceptance tests.

After the credentials have been setup, you can run Terraform Configuration in test-infra to deploy the required cloud provider resources.

Azure

For Azure, you will need to create a Resource Group with the name "terraform-acceptance-tests" and also a Service Principle as instructed by the azurerm provider. Instructions can be found here.

After running the test infrastructure, please copy the service key from the output to your environment setup script. This will be needed for the acceptance tests.

Google Cloud

For Google Cloud, you will need to have a valid account and a project created that you can deploy resource in to.

AWS

For Amazon Web Services, you will need to have a valid IAM identity with permission to create resources.