commit 1a104a0e1d9e9ec97df2a663fa7ec71b535eb724 parent 244904813f755581cc5016c3601814f947de3e10 Author: pyratebeard <root@pyratebeard.net> Date: Mon, 23 Jan 2023 13:01:51 +0000 simple vultr instance on freebsd Diffstat:
A | vultr/infra.tf | | | 10 | ++++++++++ |
A | vultr/provider.tf | | | 15 | +++++++++++++++ |
A | vultr/variables.tf | | | 23 | +++++++++++++++++++++++ |
3 files changed, 48 insertions(+), 0 deletions(-)
diff --git a/vultr/infra.tf b/vultr/infra.tf @@ -0,0 +1,10 @@ +resource "vultr_instance" "zshtest" { + os_id = 447 + region = "lhr" + plan = "vc2-1c-1gb" + count = var.instance_count + hostname = "${var.hostname}0${count.index + 1}" + ssh_key_ids = [ + "91abc987-5897-4661-8249-f1286693914e" + ] +} diff --git a/vultr/provider.tf b/vultr/provider.tf @@ -0,0 +1,15 @@ +terraform { + required_providers { + vultr = { + source = "vultr/vultr" + version = "2.12.0" + } + } +} + +provider "vultr" { + api_key = var.vultr_api_key + rate_limit = 100 + retry_limit = 3 +} + diff --git a/vultr/variables.tf b/vultr/variables.tf @@ -0,0 +1,23 @@ +variable "vultr_api_key" { + type = string + description = "Vultr PAT token" + default = "" +} + +variable "pvt_key" { + type = string + description = "private ssh key" + default = "null" +} + +variable "hostname" { + type = string + description = "hostname of system" + default = "test" +} + +variable "instance_count" { + type = string + description = "number of instances to create" + default = "1" +}