HashiCorp Terraform 0.2

HashiCorp Terraform 0.2

Aug 28 2014 Mitchell Hashimoto

We are releasing Terraform 0.2. Terraform is a tool for safely and efficiently building, combining, and launching infrastructure.

Terraform 0.1 was released just under a month ago, and Terraform 0.2 fixes many bugs, introduces new providers, and exposes a way to very easily create new providers. There are a handful of minor backwards incompatibilities, as well.

The major changes in Terraform 0.2 are the introduction of a Mailgun provider, a Google Cloud provider for Google Compute Engine, and a framework for writing new providers.

Terraform 0.2 can be downloaded here, and the full changelog can be viewed here. The changelog includes the list of backwards incompatibilities.

Read on to learn more about the new features, improvements, and changes to Terraform.


Provider Creation Framework

Terraform 0.2 includes a high-level framework for writing new providers or new resources in existing providers. As an example, writing the new Google Cloud provider took about 6 total hours of coding time with this new framework.

Writing providers with Terraform 0.1 wasn't impossible, but it was error prone and tedious. With 0.2, writing providers is simple: define a configuration schema and resource CRUD operations

resource "google_compute_instance" "foobar" { name = "app-1" machine_type = "n1-standard-1" zone = "us-central1-a" tags = ["web"]

disk {
    image = "debian-7-wheezy-v20140814"

network {
    source = "default"
    address = "${google_compute_address.webaddr.address}"

metadata {
    foo = "bar"


New Provider: Mailgun

Also included in Terraform 0.2 is a Mailgun provider. Mailgun is an email service. Having this provider allows you to setup email services for your application all within your single Terraform file.

An example of what this looks like is shown below. For full documentation, see the Mailgun provider documentation.

resource "mailgun_domain" "foobar" { name = "app.example.com" spam_action = "disabled" smtp_password = "foobar" wildcard = true }

Improvements and Bug Fixes

We've also made some nice improvements to Terraform while fixing a number of bugs. The full list of these can be found in the changelog, but here are some noteworthy changes:

  • ~/.terraformrc (Unix) or %APPDATA%/terraform.rc (Windows) can be used for global Terraform configuration. Most importantly, new plugins can be defined here.

  • A new function concat has been introduced for config file to concatenate strings. This is useful for multi-level map lookups, e.g.: ${lookup(var.amis, concat(var.region, "-beta")}

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now