Skip to content

cehoffman/triton-terraform

 
 

Repository files navigation

triton-terraform

wercker status

Table of Contents

Installing

From a release

Download a release from the releases page on Github, then add the binary to your provider config in ~/.terraformrc like so:

providers {
  triton = "/path/where/you/expanded/triton-terraform"
}

From source

If you want the latest version, install go and run go get github.com/joyent/triton-terraform. The plugin should be built and added to your Go binary folder. You'll then need to add the binary to your provider config in ~/.terraformrc like so:

providers {
  triton = "triton-terraform"
}

Provider

You'll need to set up the provider in a Terraform config file, like so:

provider "triton" {
  account = "your-account-name"
  key = "~/.ssh/joyent.id_rsa" # the path to your key. If removed, defaults to ~/.ssh/id_rsa
  key_id = "50:87:72:54:cb:25:bf:af:b2:c9:61:19:59:93:fb:ab" # the corresponding key signature from your account page
}

Resources

triton_key

Creates and manages authentication keys in Triton. Do note that any change to this resource, once created, will result in the old resource being destroyed and recreated.

name is optional if there is a comment set on the key.

resource "triton_key" "testkey" {
  name = "test key"
  key = "${file("some/other/id_rsa.pub")}"
}

triton_machine

Creates and manages machines in Triton. Below is a fairly complete resource:

resource "triton_machine" "testmachine" {
  name = "test-machine"
  package = "g3-standard-0.25-smartos"
  image = "842e6fa6-6e9b-11e5-8402-1b490459e334"
  tags = {
    test = "hello!"
  }
  networks = ["42325ea0-eb62-44c1-8eb6-0af3e2f83abc"]
}

triton_firewall_rule

Creates and manages firewall rules in Triton. Note that the API currently defaults rules to being disabled, so this provider does too.

resource "triton_firewall_rule" "testrule" {
    rule = "FROM any TO tag www ALLOW tcp PORT 80"
    enabled = true
}

Notes:

  • you can use the package UUID instead of the name, but Terraform will think that you want to change it and recreate the resource every time if you do.
  • to use metadata keys, change dashes to underscores, and use them as top-level keys in the resource. For example, user-script becomes user_script.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 98.1%
  • Makefile 1.9%