Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Infrastructure as Code Cookbook
  • Table Of Contents Toc
  • Feedback & Rating feedback
Infrastructure as Code Cookbook

Infrastructure as Code Cookbook

By : Stephane Jourdan, Pierre Pomès
4 (1)
close
close
Infrastructure as Code Cookbook

Infrastructure as Code Cookbook

4 (1)
By: Stephane Jourdan, Pierre Pomès

Overview of this book

Para 1: Infrastructure as code is transforming the way we solve infrastructural challenges. This book will show you how to make managing servers in the cloud faster, easier and more effective than ever before. With over 90 practical recipes for success, make the very most out of IAC.
Table of Contents (12 chapters)
close
close
11
Index

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:

variable "do_token" {
  description = "Digital Ocean Token"
}

Also, don't forget to set it in a private terraform.tfvars file:

do_token = "a1b2c3d4e5f6"

Handling the SSH key

We know that we'll need an SSH key to log into the cluster members. With Digital...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY