Skip to content
This repository was archived by the owner on Apr 15, 2024. It is now read-only.

CognitiveScale/terraform-provider-softlayer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform provider for SoftLayer

This is a terraform provider that lets you provision servers on SoftLayer via Terraform.

Installing

For now, there are no published artifacts/binaries for this provider. In order to use it, you must compile the project from source, and then put the terraform-provider-softlayer binary somewhere in your system.

Copied from the Terraform documentation:

To install a plugin, put the binary somewhere on your filesystem, then configure Terraform to be able to find it. The configuration where plugins are defined is ~/.terraformrc for Unix-like systems and %APPDATA%/terraform.rc for Windows.

This is what you would need to add to your .terraformrc, if you have built the project from source:

providers {
  softlayer = "$GOPATH/bin/terraform-provider-softlayer"
}

If the binary is placed somewhere else, update the path accordingly.

Using the provider

Example for setting up a virtual server with an SSH key:

provider "softlayer" {
    username = ""
    api_key = ""
}

resource "softlayer_ssh_key" "my_key" {
    name = "my_key"
    public_key = "~/.ssh/id_rsa.pub"
}

resource "softlayer_virtualserver" "my_server" {
    name = "my_server"
    domain = "example.com"
    ssh_keys = ["${softlayer_ssh_key.my_key.id}"]
    image = "DEBIAN_7_64"
    region = "ams01"
    public_network_speed = 10
    cpu = 1
    ram = 1024
    disks = [25, 10, 20]
    user_data = "{\"fox\":[45]}"
}

You'll need to provide your SoftLayer username and API key, so that Terraform can connect. If you don't want to put credentials in your configuration file, you can leave them out:

provider "softlayer" {}

...and instead set these environment variables:

  • SOFTLAYER_USERNAME: Your SoftLayer username
  • SOFTLAYER_API_KEY: Your API key

Building

  1. Install Go on your machine
  2. Set up Gopath
  3. git clone this repository into $GOPATH/src/github.com/finn-no/terraform-provider-softlayer
  4. Run go get to get dependencies
  5. Run go install to build the binary. You will now find the binary at $GOPATH/bin/terraform-provider-softlayer.

About

This is a provider for Terraform that lets you provision infrastructure on SoftLayer.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Go 100.0%