• Stars
    star
    168
  • Rank 224,933 (Top 5 %)
  • Language
    Go
  • License
    Mozilla Public Li...
  • Created about 7 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Terraform Vultr Provider

Vultr Terraform Provider

This is a Terraform provider for Vultr. Find out more about Vultr.

Build Status Go Report Card

Requirements

  • A Vultr account and API key
  • Terraform 0.12+
  • Go 1.8 (to build the provider plugin)

Usage

Download terraform-provider-vultr from the releases page and follow the instructions to install it as a plugin. After placing it into your plugins directory, run terraform init to initialize it.

Note: in order to build and install the provider from the latest commit on master, run:

go get -u github.com/squat/terraform-provider-vultr

and then register the plugin by symlinking the binary to the third-party plugins directory:

mkdir -p ~/.terraform.d/plugins
ln -s "$GOPATH/bin/terraform-provider-vultr" ~/.terraform.d/plugins/terraform-provider-vultr

Set an environment variable containing the Vultr API key:

export VULTR_API_KEY=<your-vultr-api-key>

Note: as an alternative, the API key can be specified in configuration as shown below.

Examples

// Configure the Vultr provider. 
// Alternatively, export the API key as an environment variable: `export VULTR_API_KEY=<your-vultr-api-key>`.
provider "vultr" {
  api_key = "<your-vultr-api-key>"
}

// Find the ID of the Silicon Valley region.
data "vultr_region" "silicon_valley" {
  filter {
    name   = "name"
    values = ["Silicon Valley"]
  }
}

// Find the ID for CoreOS Container Linux.
data "vultr_os" "container_linux" {
  filter {
    name   = "family"
    values = ["coreos"]
  }
}

// Find the ID for a starter plan.
data "vultr_plan" "starter" {
  filter {
    name   = "price_per_month"
    values = ["5.00"]
  }

  filter {
    name   = "ram"
    values = ["1024"]
  }
}

// Find the ID of an existing SSH key.
data "vultr_ssh_key" "squat" {
  filter {
    name   = "name"
    values = ["squat"]
  }
}

// Create a Vultr virtual machine.
resource "vultr_instance" "example" {
  name              = "example"
  region_id         = "${data.vultr_region.silicon_valley.id}"
  plan_id           = "${data.vultr_plan.starter.id}"
  os_id             = "${data.vultr_os.container_linux.id}"
  ssh_key_ids       = ["${data.vultr_ssh_key.squat.id}"]
  hostname          = "example"
  tag               = "container-linux"
  firewall_group_id = "${vultr_firewall_group.example.id}"
}

// Create a new firewall group.
resource "vultr_firewall_group" "example" {
  description = "example group"
}

// Add a firewall rule to the group allowing SSH access.
resource "vultr_firewall_rule" "ssh" {
  firewall_group_id = "${vultr_firewall_group.example.id}"
  cidr_block        = "0.0.0.0/0"
  protocol          = "tcp"
  from_port         = 22
  to_port           = 22
}

Development

To develop the plugin locally, install the following dependencies:

  • Go 1.8 (to build the provider plugin)
  • Glide (to install and maintain dependencies)
  • glide-vc (to clean up dependencies)

To build the plugin run:

make build

To update Go dependencies run:

make vendor

More Repositories

1

kilo

Kilo is a multi-cloud network overlay built on WireGuard and designed for Kubernetes (k8s + wg = kg)
Go
1,990
star
2

generic-device-plugin

A Kubernetes device plugin to schedule generic Linux devices
Go
162
star
3

drae

A RESTful API for el Diccionario de la Real Academia Española
Go
62
star
4

postpone

Postpone your resources and save some bandwidth
JavaScript
60
star
5

modulus

Automatically compile kernel modules for Flatcar Linux / CoreOS Container Linux
Shell
33
star
6

service-reflector

Service-Reflector mirrors Kubernetes Services so that Pods in one cluster can natively access Services in another
Go
22
star
7

kubeconeu2019

KubeCon EU 2019 talk on building multi-cloud clusters with WireGuard
HCL
11
star
8

kubeconeu2020

KubeCon EU 2020 talk on scaling metrics ingestion with Thanos receive
10
star
9

kilo-wg-gen-web

Use Wg Gen Web to manage Kilo peers
Go
10
star
10

fluxcdbot

A Telegram bot for Flux CD
Go
6
star
11

onseu2019

ONS EU 2019 talk on connecting Kubernetes clusters with Kilo
HCL
6
star
12

darkapi

An API for Darknet image detection neural networks like YOLO
C
5
star
13

typhoon-vultr

Vultr fork of Typhoon, a minimal and free Kubernetes distribution
HCL
5
star
14

node-jp2a

A node wrapper for the jp2a CLI tool
JavaScript
5
star
15

kilosubspace

Use Subspace to manage Kilo peers
Makefile
5
star
16

jupyter-operator

A Kubernetes operator for Jupyter Notebooks
Go
5
star
17

configmap-to-disk

configmap-to-disk synchronizes a ConfigMap from the Kubernetes API to disk
Go
4
star
18

hetzner-cloud-flatcar-linux

Terraform module for creating Flatcar Linux servers in Hetzner Cloud
HCL
2
star
19

onboard

Easily connect IoT devices to your fleet
Go
2
star
20

coreos-ovh

Install CoreOS Linux on OVH VPS
Shell
2
star
21

acatiris

An ASCII Art Middleware for Express
JavaScript
2
star
22

kubeconeu2018

KubeCon EU 2018 talk on automating GPU infrastructure for Kubernetes on Container Linux
HCL
2
star
23

keewee

Deploy self-hosted KeeWeb
Makefile
2
star
24

berlinstrength

an RFID scanner application for Berlin Strength
TypeScript
2
star
25

hetzner-cloud-kubeadm

Terraform module for creating creating a kubeadm cluster in Hetzner Cloud
HCL
1
star
26

servor

a tiny HTTP API for controlling servos via GPIO
Go
1
star
27

fileckr

Upload files to Flickr and make use of your 1TB of free storage
Go
1
star
28

pre-commit-sops

A pre-commit hook that detects SOPS secrets that are unencrypted or encrypted with the wrong key(s)
1
star
29

terraform-provider-saladcloud

Terraform Provider for SaladCloud
Go
1
star
30

drivefs

Use Google Drive as a static file server
Go
1
star