Terraform: Difference between revisions

Jump to navigation Jump to search
adapt intro to non-staff audience
(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 its users 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.
[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.


In this series we introduce Compute Canada Federation colleagues to Terraform and demonstrate its use on our OpenStack clouds.
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.
 
In this first tutorial, 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, it would be helpful to familiarize yourself with it by creating a VM, attaching a volume, associating a floating IP, and ensuring you can login to the VM afterwards. This guide also assumes you already have an SSH keypair created and the public key stored with 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, 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 provided by Compute Canada will get you going.
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 in the wild 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.
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 ===
Bureaucrats, cc_docs_admin, cc_staff
2,879

edits

Navigation menu