Skip to content
Terraform provider for Online.net
Go Shell Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
online
provider Use 0.12 terraform sdk and improve acceptance tests (#54) May 27, 2019
scripts
vendor
.gitignore Add a Makefile Sep 26, 2018
.lookout.yml
.travis.yml Terraform 0.12 preparations (#53) Apr 4, 2019
CHANGELOG.md
LICENSE Add license file Sep 27, 2018
Makefile
README.md Document env vars for testacc (#55) May 27, 2019
go.mod Use 0.12 terraform sdk and improve acceptance tests (#54) May 27, 2019
go.sum
main.go Rename repo to terraform-provider-online Oct 3, 2018

README.md

Terraform Provider for Online.net

Requirements

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

Building The Provider

Clone repository to: $GOPATH/src/github.com/src-d/terraform-provider-online.

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

Enter the provider directory and build the provider:

$ cd $GOPATH/src/github.com/src-d/terraform-provider-online
$ make build

To install it in your home directory to test the provider:

$ cd $GOPATH/src/github.com/src-d/terraform-provider-online
$ make local-install

Installing the provider

Installation from binaries (recommended)

The recommended way to install terraform-provider-online is use the binary distributions from the Releases page. The packages are available for Linux and macOS.

Download and uncompress the latest release for your OS. This example uses the linux binary.

$ wget https://github.com/src-d/terraform-provider-online/releases/download/v0.1.0/terraform-provider-online_v0.1.0_linux_amd64.tar.gz
$ tar -xvf terraform-provider-online*.tar.gz

Now copy the binary to the Terraform's plugins folder (if this is your first plugin maybe it isn't present):

$ mkdir -p ~/.terraform.d/plugins/
$ mv terraform-provider-online*/terraform-provider-online ~/.terraform.d/plugins/

Using the provider

To do: add documentation

Developing the Provider

If you wish to work on the provider, you'll first need Go installed on your machine (version 1.8+ 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-online
...

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.

Acceptance tests need an authentication token and an Online.net server which will be used to run the tests against. The server will be modified, using a production system is not adviced. All used servers must support RPNv2. It will look for:

Environment Variable Description Example
ONLINE_SERVER_ID ID of a dedicated server (only the numeric part) 46952
ONLINE_SERVER_ID_2 ID of a 2nd dedicated server (only the numeric part) 46953
ONLINE_FAILVOVER_IP An available failover IP 81.23.14.1
ONLINE_TOKEN Online.net auth token received from https://console.online.net/en/api/access
$ make testacc

License

Mozilla Public License Version 2.0, see LICENSE

You can’t perform that action at this time.