Knowledge Base  /  Ecosystem Partners  /  Marketplace Guides
Knowledge Base  /  Ecosystem Partners  /  Marketplace Guides

Getting started with Hashicorp Terraform

Updated by [email protected] on Dec 10, 2015


After reading this article, the user should be able to provision infrastructure with Hashicorp Terraform on CenturyLink Cloud.



Hashicorp Terraform – “Terraform provides a common configuration to launch infrastructure — from physical and virtual servers to email and DNS providers. Once launched, Terraform safely and efficiently changes infrastructure as the configuration is evolved.”


Terraform users wishing to deploy to CenturyLink Cloud. Familiarity with infrastructure automation and the terraform toolkit are required.

Full documentaiton for terraform on CLC.


  1. Install Terraform.

  2. Set Credentials. The plugin expects CLC credentials set either as env vars:


    Or via terraform variables:

         provider "clc" {
               username = ""
             password = ""
             account = "" # optional

    If not provided, account will default to the user's primary account. Sub-account may also be specified.

  3. Test. Save the following into a file called

         provider "clc" {
               username = ""
             password = ""
         resource "clc_group" "web" {
           location_id = "WA1"
           name = "TERRA"
           parent = "Default Group"
         resource "clc_server" "srv" {
           name_template = "trusty"
           source_server_id = "UBUNTU-14-64-TEMPLATE"
           group_id = "${}"
           cpu = 2
           memory_mb = 2048

    And then run

    terraform plan

    If all goes well, terraform should report the execution plan it will lay down.

    terraform apply

    Apply will execute the plan and provision cloud resources.

    Check out the full options available for VMs (and other resources) on the official docs

  4. Explore the examples. Additional example and resources:

  5. Start terraform'ing. Use the provided terraform resources to build out your infrastructure.