Skip to content

Instantly share code, notes, and snippets.

@jen20
Last active August 29, 2015 14:14
Show Gist options
  • Select an option

  • Save jen20/88dba8cbafc26e7fe234 to your computer and use it in GitHub Desktop.

Select an option

Save jen20/88dba8cbafc26e7fe234 to your computer and use it in GitHub Desktop.
Currently working on this. Looking like the best available tooling for Azure provisioning so far!
$ cat test.tf
provider "azure" {
#Note: this shouldn't be here (should be an env var) but this is easier for testing
publishsettings_file = "~/.publishProfiles/Subscription-Provisioning.publishSettings"
}
resource "azure_vm" "puppetmaster" {
image = "ubuntu14.04"
instance_size = "Standard_D1"
provisioner "remote-exec" {
script = "./bootstrap/puppet-master.sh"
}
}
resource "azure_cloudservice" "consul" {
label = "Consul"
description = "Consul cluster"
location = "East US 2"
reverse_dns_fqdn = "consul.motos.wtf"
virtual_machines = ["${azure_vm.consul.*.id}"]
}
resource "azure_vm" "consul" {
image = "ubuntu14.04"
instance_size = "Standard_D1"
count = 3
provisioner "remote-exec" {
script = "./bootstrap/puppet-agent.sh"
}
}
$ terraform plan
Refreshing Terraform state prior to plan...
The Terraform execution plan has been generated and is shown below.
Resources are shown in alphabetical order for quick scanning. Green resources
will be created (or destroyed and then created if an existing resource
exists), yellow resources are being changed in-place, and red resources
will be destroyed.
Note: You didn't specify an "-out" parameter to save this plan, so when
"apply" is called, Terraform can't guarantee this is what will execute.
+ azure_cloudservice.consul
description: "" => "Consul cluster"
label: "" => "Consul"
location: "" => "East US 2"
reverse_dns_fqdn: "" => "consul.motos.wtf"
virtual_machines.#: "" => "<computed>"
+ azure_vm.consul.0
image: "" => "ubuntu14.04"
instance_size: "" => "Standard_D1"
+ azure_vm.consul.1
image: "" => "ubuntu14.04"
instance_size: "" => "Standard_D1"
+ azure_vm.consul.2
image: "" => "ubuntu14.04"
instance_size: "" => "Standard_D1"
+ azure_vm.puppetmaster
image: "" => "ubuntu14.04"
instance_size: "" => "Standard_D1"
$ terraform graph > test.gv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment