GithubHelp home page GithubHelp logo

liquidweb / terraform-provider-liquidweb Goto Github PK

View Code? Open in Web Editor NEW
6.0 12.0 1.0 278 KB

Terraform Provider for Liquid Web's Storm web services

License: Apache License 2.0

Go 100.00%
terraform-provider terraform golang liquidweb

terraform-provider-liquidweb's Introduction

Liquid Web Terraform Provider

Build Status

Developing

If you want to develop for this, you need go1.21+ and terraform 1.5+.

Tests can be run with (from the root of this repository):

go test -v ./...

This can be built with:

go build

Then to use a bin you built, relative to your terraform minfests copy it to:

~/terraform.d/plugins/local.providers/liquidweb/liquidweb/1.6.0/darwin_amd64/terraform-provider-liquidweb
  • darwin_amd64 changes relevative to your platform
  • 1.6.0 is relative to what version this is`

Tracing

Tracing via Jaeger is available so various actions: successful API patterns, bottlenecks and problems can be identified recognized accordingly. It's important to capture where we're getting things right as much as wrong.

make jaeger
xdg-open http://localhost:16686/search

Tracing is enabled if JAEGER_DISABLED is set to false. This requires the jaeger container to be running and general use with an external Terraform project isn't yet supported.

Using this Provider

All things for this section are relative to your terraform manifests.

This terraform provider is currently not published. Thus, you need the provider compiled above at the location above.

You also currently need the following toml file with your credentials.

  • Create a .lwapi.toml file in the root directory:
[lwApi]
username = "[yourusername]"
password = "[yourpassword]"
url = "https://api.liquidweb.com"
timeout = 15

These both then need to be included in with a provider block like:

terraform {
  required_providers {
    liquidweb = {
      source = "local.providers/liquidweb/liquidweb"
      version = "~> 1.5.8"
    }
  }
}

variable "liquidweb_config_path" {
  type = string
}

provider "liquidweb" {
  config_path = var.liquidweb_config_path
}

Examples

In the examples directory there are Terraform manifests demonstrating usage. Everything needs provider.tf, most others are only dependent on themselves.

There are also a few example projects in that folder.

Cloud Servers

data "liquidweb_network_zone" "testing" {
  name        = "Zone C"
  region_name = "US Central"
}

resource "liquidweb_cloud_server" "testing" {
  count = 1

  config_id      = 1090
  zone           = data.liquidweb_network_zone.testing.id
  template       = "UBUNTU_1804_UNMANAGED"                     // ubuntu 18.04
  domain         = "terraform-testing.api.${count.index}.masre.net"
  password       = "11111aA"
  public_ssh_key = file("./devkey.pub")
}

Cloud Servers + Load Balancer

data "liquidweb_network_zone" "testing" {
  name        = "Zone C"
  region_name = "US Central"
}

resource "" "testing" {
  count = 1

  config_id      = 1090
  zone           = data.liquidweb_network_zone.testing.id
  template       = "UBUNTU_1804_UNMANAGED"                     // ubuntu 18.04
  domain         = "terraform-testing.api.${count.index}.masre.net"
  password       = "11111aA"
  public_ssh_key = file("./devkey.pub")
}

resource "liquidweb_network_load_balancer" "testing" {
  name       = "testing"
  region = data.liquidweb_network_zone.testing.region_id

  nodes = .testing[*].ip

  service {
    src_port  = 80
    dest_port = 80
  }

  service {
    src_port  = 1337
    dest_port = 1337
  }

  strategy = "roundrobin"
}

Cloud Configs

data "liquidweb_network_zone" "testing" {
  name        = "Zone C"
  region_name = "US Central"
}

data "_config" "testing" {
  vcpu         = 2
  memory       = "2000"
  disk         = "100"
  network_zone = data.liquidweb_network_zone.testing.id
}

DNS

resource "liquidweb_network_dns_record" "testing" {
  name  = "terraform-testing.api.${count.index}.masre.net"
  type  = "A"
  rdata = "127.0.0.1"
  zone  = "masre.net"
}

Block Volumes

resource "liquidweb_network_block_volume" "testing" {
  attach = "2GHUN4"
  domain = "blarstacoman"
  size   = 10
}

VIP

resource "liquidweb_network_vip" "testing" {
  domain  = "terraform-testing-vip"
  zone    = 52
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.