diff --git a/linode.tf b/caladan.tf similarity index 96% rename from linode.tf rename to caladan.tf index 9ce45cd..39593cc 100644 --- a/linode.tf +++ b/caladan.tf @@ -1,6 +1,3 @@ -provider "linode" { -} - # https://www.linode.com/docs/guides/import-existing-infrastructure-to-terraform/ resource "linode_instance" "caladan-vm" { label = "caladan" diff --git a/main.tf b/main.tf index 25a39a7..93818b2 100644 --- a/main.tf +++ b/main.tf @@ -9,5 +9,22 @@ terraform { source = "linode/linode" version = ">= 1.29.0" } + vultr = { + source = "vultr/vultr" + version = "2.11.4" + } } } + +provider "namecheap" { + user_name = "gthar" + api_user = "gthar" + client_ip = "139.162.137.29" // caladan's public IP + use_sandbox = false +} + +provider "linode" { +} + +provider "vultr" { +} diff --git a/namecheap.tf b/monotremata-xyz.tf similarity index 97% rename from namecheap.tf rename to monotremata-xyz.tf index 9dcf2ea..c5dd73d 100644 --- a/namecheap.tf +++ b/monotremata-xyz.tf @@ -127,13 +127,6 @@ variable "sloth-subdomains" { ] } -provider "namecheap" { - user_name = "gthar" - api_user = "gthar" - client_ip = var.hosts.caladan.v4 - use_sandbox = false -} - resource "namecheap_domain_records" "monotremata-xyz" { domain = "monotremata.xyz" mode = "MERGE" diff --git a/run_terraform b/run_terraform index 9e7dd0f..3aecbc8 100755 --- a/run_terraform +++ b/run_terraform @@ -1,12 +1,14 @@ #!/bin/sh +NAMECHEAP_API_KEY=$(pass namecheap.com/api_key) +LINODE_TOKEN=$(pass linode.com/token) +VULTR_API_KEY=$(pass vultr.com/api_key) + export HTTP_PROXY=caladan:8888 export HTTPS_PROXY=caladan:8888 -NAMECHEAP_API_KEY=$(pass namecheap.com/api_key) export NAMECHEAP_API_KEY - -LINODE_TOKEN=$(pass linode.com/token) export LINODE_TOKEN +export VULTR_API_KEY terraform "$@"