github.com/mattyr/nomad@v0.3.3-0.20160919021406-3485a065154a/demo/digitalocean/terraform/statsite/main.tf (about)

     1  variable "size" { default = "1gb" }
     2  variable "region" {}
     3  variable "ssh_keys" {}
     4  
     5  resource "atlas_artifact" "statsite-digitalocean" {
     6    name    = "hashicorp/nomad-demo-statsite"
     7    type    = "digitalocean.image"
     8    version = "latest"
     9  }
    10  
    11  resource "digitalocean_droplet" "statsite" {
    12    image    = "${atlas_artifact.statsite-digitalocean.id}"
    13    name     = "nomad-statsite-${var.region}-${count.index}"
    14    count    = 1
    15    size     = "${var.size}"
    16    region   = "${var.region}"
    17    ssh_keys = ["${split(",", var.ssh_keys)}"]
    18  
    19    provisioner "remote-exec" {
    20      inline = "sudo start statsite || true"
    21    }
    22  }
    23  
    24  output "addr" {
    25    value = "${digitalocean_droplet.statsite.ipv4_address}:8125"
    26  }