Skip to content

Instantly share code, notes, and snippets.

@jwreagor
Created March 6, 2018 18:50
Show Gist options
  • Save jwreagor/21b8515444b4145742a12efe051a6b8e to your computer and use it in GitHub Desktop.
Save jwreagor/21b8515444b4145742a12efe051a6b8e to your computer and use it in GitHub Desktop.
Example Terraform configuration w/ TSG
provider "triton" {
insecure_skip_tls_verify = true
}
data "triton_network" "public" {
name = "Joyent-SDC-Public"
}
data "triton_image" "lts" {
name = "base-64-lts"
most_recent = true
}
resource "triton_instance_template" "template" {
template_name = "cheap-template-1"
instance_name_prefix = "cheap-"
image = "${data.triton_image.lts.id}"
package = "g4-highcpu-1G"
networks = ["${data.triton_network.public.id}"]
firewall_enabled = true
tags {
admin = "cheap"
foo = "bar"
}
metadata {
hello = "again"
}
userdata = "bash script here"
}
resource "triton_service_group" "group" {
group_name = "cheap-group-1"
template = "${triton_instance_template.template.id}"
capacity = 3
health_check_interval = 20
}
output "template_id" {
value = "${triton_instance_template.template.id}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment