├── .gitignore ├── README.md └── examples └── triton-docker-combined ├── .gitignore ├── terraform.tfvars.example ├── triton.tf └── variables.tf /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | build 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Triton provider for Terraform 2 | 3 | The Triton provider for [Terraform](https://www.terraform.io) has been [upstreamed](https://github.com/hashicorp/terraform/pull/5738) since [0.6.14](https://github.com/hashicorp/terraform/blob/master/CHANGELOG.md#0614-march-21-2016). 4 | 5 | ### Learn more 6 | 7 | - [What is Terraform](https://www.terraform.io/intro/index.html)? 8 | - [Installing Terraform](https://www.terraform.io/intro/getting-started/install.html) 9 | - [Using the Triton provider](https://www.terraform.io/docs/providers/triton/index.html) 10 | 11 | ### Community and support 12 | 13 | - The sdc-discuss mailing list is a great starting point for questions about how to use and manage Triton, including with Terraform: [Subscribe](https://www.listbox.com/subscribe/?list_id=247449), [archives](https://www.listbox.com/member/archive/247449/=now). 14 | - The Terraform [mailing list](https://groups.google.com/group/terraform-tool) and IRC channel (`#terraform-tool` on Freenode) are great for general questions about Terraform. 15 | - Joyent customers can [contact support](https://docs.joyent.com/public-cloud/getting-started/support) for issues specific to Terraform on Triton and in the Joyent public cloud. 16 | 17 | ### Bugs 18 | 19 | Please report bugs (do not ask for general help) in the [GitHub issue tracker for Terraform](https://github.com/hashicorp/terraform/issues). -------------------------------------------------------------------------------- /examples/triton-docker-combined/.gitignore: -------------------------------------------------------------------------------- 1 | terraform.tfvars 2 | *.tfstate 3 | -------------------------------------------------------------------------------- /examples/triton-docker-combined/terraform.tfvars.example: -------------------------------------------------------------------------------- 1 | triton_account = "bobby.brown" 2 | triton_url = "https://us-sw-1.api.joyentcloud.com" 3 | triton_key_path = "~/.ssh/joyent_id_rsa" 4 | triton_key_id = "" 5 | 6 | docker_cert_path = "/Users//.sdc/docker/" 7 | docker_host = "tcp://us-sw-1.docker.joyent.com:2376" 8 | -------------------------------------------------------------------------------- /examples/triton-docker-combined/triton.tf: -------------------------------------------------------------------------------- 1 | # See http://www.joyent.com/blog/introducing-hashicorp-terraform-for-joyent-triton 2 | 3 | provider "triton" { 4 | account = "${var.triton_account}" 5 | key = "${var.triton_key_path}" 6 | key_id = "${var.triton_key_id}" 7 | url = "${var.triton_url}" 8 | } 9 | 10 | provider "docker" { 11 | host = "${var.docker_host}" 12 | cert_path = "${var.docker_cert_path}" 13 | } 14 | 15 | resource "docker_image" "nginx" { 16 | name = "nginx:latest" 17 | keep_updated = true 18 | } 19 | 20 | resource "docker_container" "nginx" { 21 | count = 1 22 | name = "nginx-terraform-${format("%02d", count.index+1)}" 23 | image = "${docker_image.nginx.latest}" 24 | must_run = true 25 | 26 | env = ["env=test", "role=test"] 27 | restart = "always" 28 | memory = 128 29 | 30 | labels { 31 | env = "test" 32 | role = "docker" 33 | } 34 | 35 | log_driver = "json-file" 36 | log_opts = { 37 | max-size = "1m" 38 | max-file = 2 39 | } 40 | 41 | ports { 42 | internal = 80 43 | external = 80 44 | } 45 | } 46 | 47 | resource "triton_machine" "testmachine" { 48 | name = "test-machine" 49 | package = "t4-standard-512M" 50 | image = "ffe82a0a-83d2-11e5-b5ac-f3e14f42f12d" 51 | 52 | count = 1 53 | } 54 | 55 | resource "triton_machine" "windowsmachine" { 56 | name = "win-test-terraform" 57 | package = "g3-standard-4-kvm" 58 | image = "66810176-4011-11e4-968f-938d7c9edfa2" 59 | 60 | count = 1 61 | } 62 | -------------------------------------------------------------------------------- /examples/triton-docker-combined/variables.tf: -------------------------------------------------------------------------------- 1 | variable "triton_account" {} 2 | variable "triton_url" { 3 | default = "https://us-sw-1.api.joyentcloud.com" 4 | } 5 | variable "triton_key_path" { 6 | default = "path to your ssh key for Triton" 7 | } 8 | variable "triton_key_id" { 9 | default = "Run 'ssh-keygen -l -E md5 -f | cut -d' ' -f2 | cut -d: -f2-'" 10 | } 11 | variable "docker_cert_path" { 12 | default = "/Users//.sdc/docker/" 13 | } 14 | variable "docker_host" { 15 | default = "tcp://us-sw-1.docker.joyent.com:2376" 16 | } 17 | --------------------------------------------------------------------------------