Bureaucrats, cc_docs_admin, cc_staff
2,879
edits
(Remove top-level section. Relocate source citation) |
(adapt intro to non-staff audience) |
||
Line 1: | Line 1: | ||
{{draft}} | {{draft}} | ||
Terraform is seeing growing use within the Compute Canada Federation. Its infrastructure-as-code allows | [https://www.terraform.io/ Terraform] is a tool for defining and provisioning datacenter infrastructure, including virtual machines. Terraform is seeing growing use within the Compute Canada Federation. Its infrastructure-as-code model allows one to maintain OpenStack resources as a collection of definitions which can be easily updated using favourite text editors, shared among members of a group, and stored in version control. | ||
This page is written as a tutorial in which we introduce Terraform and demonstrate its use on our OpenStack clouds. We set up our local workspace for Terraform and create a VM with a floating IP and attached volume. | |||
== Preparation == | == Preparation == | ||
Before starting with Terraform, you need access to an OpenStack tenant with available resources, Terraform itself, and a few things configured on your workstation or laptop. | Before starting with Terraform, you need | ||
* access to an OpenStack tenant with available resources, | |||
* Terraform itself, and | |||
* a few things configured on your workstation or laptop. | |||
=== Access to OpenStack === | === Access to OpenStack === | ||
For access to the cloud, see [[Cloud#Getting_a_Cloud_project | Getting a Cloud project]] on the Compute Canada Docs wiki. If you’ve never used OpenStack before, | For access to the cloud, see [[Cloud#Getting_a_Cloud_project | Getting a Cloud project]] on the Compute Canada Docs wiki. If you’ve never used OpenStack before, you should familiarize yourself with it first by creating a VM, attaching a volume, associating a floating IP, and ensuring you can login to the VM afterwards. This tutorial also assumes you already have an SSH keypair created and the public key stored with OpenStack. | ||
If you don’t know how to do these things, the [[Cloud Quick Start]] guide | If you don’t know how to do these things, the [[Cloud Quick Start]] guide will get you going. | ||
The experience of creating these resources using the web interface will lay a foundation for understanding both what Terraform is doing, and where it has value. | The experience of creating these resources using the web interface will lay a foundation for understanding both what Terraform is doing, and where it has value. | ||
Line 21: | Line 22: | ||
=== Terraform === | === Terraform === | ||
See the [https://www.terraform.io/downloads.html Terraform downloads page] for the latest client. This guide is based on Terraform 0.12, which as of this writing has been | See the [https://www.terraform.io/downloads.html Terraform downloads page] for the latest client. This guide is based on Terraform 0.12, which as of this writing has been available for less than a month. Version 0.12 contains a fair number of changes over v0.11, including a clearer syntax, and though the release is quite new, it’s been in development for a while, solves some fundamental issues users were having in using Terraform effectively, and at any rate is the direction Terraform is going. | ||
=== Credentials === | === Credentials === |