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

Getting started with Hashicorp Terraform

Updated by 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 documentation for using 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 an account is not provided, it will default to the user's primary account. A sub-account may also be specified.

  3. Test.
    Save the following into a file named

       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

    Terraform should report the execution plan it will lay down.

    terraform apply

will execute the plan and provision cloud resources.

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

  1. Explore the examples.
    Additional example and resources:

  2. Start Terraforming.
    Use the provided Terraform resources to build out your infrastructure.