first namecheap domain added

main
Ricard Illa 2022-08-18 18:16:44 +02:00
parent b9b39a45fa
commit 8c3b66dfe2
No known key found for this signature in database
GPG Key ID: F69A672B72E54902
3 changed files with 32 additions and 0 deletions

View File

@ -1,3 +1,9 @@
terraform { terraform {
backend "pg" {} backend "pg" {}
required_providers {
namecheap = {
source = "namecheap/namecheap"
version = ">= 2.0.0"
}
}
} }

24
namecheap.tf Normal file
View File

@ -0,0 +1,24 @@
// https://registry.terraform.io/providers/namecheap/namecheap/latest/docs
variable "caladan-ip" {
type = string
default = "139.162.137.29"
}
provider "namecheap" {
user_name = "gthar"
api_user = "gthar"
client_ip = var.caladan-ip
use_sandbox = false
}
resource "namecheap_domain_records" "monotremata-xyz" {
domain = "monotremata.xyz"
mode = "MERGE" // maybe eventually move to OVERWRITE
record {
hostname = "@"
type = "A"
address = var.caladan-ip
}
}

View File

@ -2,5 +2,7 @@
export HTTP_PROXY=caladan:8888 export HTTP_PROXY=caladan:8888
export HTTPS_PROXY=caladan:8888 export HTTPS_PROXY=caladan:8888
NAMECHEAP_API_KEY=$(pass namecheap.com/api_key)
export NAMECHEAP_API_KEY
terraform "$@" terraform "$@"