Provisioning a complete CoreOS infrastructure on Digital Ocean with Terraform

In this recipe, we'll build from scratch a fully working CoreOS cluster on Digital Ocean in their New York region, using Terraform and cloud-init. We'll add some latency monitoring as well with StatusCake, so we have a good foundation of using Terraform on Digital Ocean.

Getting ready

To step through this recipe, you will need the following:

  • A working Terraform installation
  • A Digital Ocean account
  • A StatusCake account
  • An Internet connection

How to do it…

Let's start by creating the digitalocean provider (it only requires an API token) in a file named providers.tf:

provider "digitalocean" {
  token = "${var.do_token}"
}

Declare the do_token variable in a file named variables.tf

Get Infrastructure as Code (IAC) Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.