Compare commits

...

4 Commits

Author SHA1 Message Date
c50deddf53 Merge branch 'master' of ssh://git.shockrah.xyz:2222/shockrah/infra
Some checks failed
Ansible Linting / ansible-lint (push) Failing after 5s
Secops Linting and Safety Checks / checkov-scan-s3 (push) Failing after 17s
2024-12-08 13:41:47 -08:00
6ab49d1b28 init option to build script 2024-12-08 13:40:56 -08:00
68acbe2842 Updating the dns with a new test entry 2024-12-08 13:40:31 -08:00
a6dc2da7be Version bumps for a fresh k8s cluster for stuff 2024-12-08 13:16:42 -08:00
8 changed files with 44 additions and 86 deletions

View File

@ -1,24 +0,0 @@
plan=out.plan
SHELL := /bin/bash
$(plan): *.tf
source ../secrets/set-env.sh && terraform plan -input=false -out $(plan)
push: build
source ../secrets/set-env.sh && terraform apply $(plan)
refresh:
source ../secrets/set-env.sh && terraform apply -refresh-only
test:
terraform validate
rip:
source ../secrets/set-env.sh && terraform destroy
clean:
rm -f $(plan)
.PHONY: test build clean push rip

34
infra/dns/build.sh Normal file
View File

@ -0,0 +1,34 @@
#!/bin/bash
set -e
opt=$1
plan=tfplan
build_plan() {
echo Generating plan
set -x
terraform plan -var-file variables.tfvars -input=false -out $plan
}
deploy_plan() {
terraform apply $plan
}
init() {
terraform init
}
help_prompt() {
cat <<- EOF
Options: plan deploy help
EOF
}
# Default to building a plan
source ./secrets.sh
case $opt in
plan) build_plan;;
deploy) deploy_plan;;
*) help_prompt;;
esac

View File

@ -1,49 +0,0 @@
#############################
# project-athens.xyz DNS ZONE
#############################
# This entry is just for the sample service that is just plain nginx
# No TLS will be placed on this just yet as we need to make sure this
# and the load balancer are setup to receive things properly
resource "aws_route53_zone" "project-athens" {
name = "project-athens.xyz"
comment = "Project Athens domain zone"
}
locals {
project-athens-records = [
{
name = "project-athens.xyz"
type = "NS"
ttl = 172800
records = [
"ns-806.awsdns-36.net.",
"ns-1881.awsdns-43.co.uk.",
"ns-1109.awsdns-10.org.",
"ns-11.awsdns-01.com.",
]
},
{
name = "project-athens.xyz"
type = "SOA"
ttl = 900
records = [
"ns-806.awsdns-36.net. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 86400"
]
}
]
}
resource "aws_route53_record" "project-athens-record" {
for_each = {
for index, record in local.project-athens-records:
index => record
}
zone_id = aws_route53_zone.project-athens.id
name = each.value.name
type = lookup(each.value, "type", "A")
ttl = lookup(each.value, "ttl", 300)
records = each.value.records
}

View File

@ -36,8 +36,10 @@ locals {
},
{ name = "www.shockrah.xyz", records = [ var.vultr_host ] },
{ name = "resume.shockrah.xyz", records = [ var.vultr_host ] },
{ name = "immich.shockrah.xyz", records = [ "45.32.92.196" ] },
{ name = "git.shockrah.xyz", records = [ var.vultr_host ] },
{ name = "immich.shockrah.xyz", records = [ "45.32.92.196" ] },
{ name = "git.shockrah.xyz", records = [ var.vultr_host ] },
# This entry will be for a mega simple website that we're gonna try and host for the lulz
{ name = "test.shockrah.xyz", records = [ "45.77.123.107" ] }
]
}

View File

@ -13,7 +13,7 @@ terraform {
}
vultr = {
source = "vultr/vultr"
version = "2.19.0"
version = "2.22.1"
}
}
}

View File

@ -15,6 +15,10 @@ deploy_plan() {
terraform apply $plan
}
init() {
terraform init
}
help_prompt() {
cat <<- EOF
Options: plan deploy help

View File

@ -37,8 +37,3 @@ variable cluster {
variable lab_domain {
type = string
}
variable lb_ip4 {
type = string
}

View File

@ -2,7 +2,7 @@
cluster = {
region = "lax"
label = "athens-cluster"
version = "v1.30.0+1"
version = "v1.31.2+1"
pool = {
plan = "vc2-1c-2gb"
autoscale = true
@ -12,7 +12,3 @@ cluster = {
}
lab_domain = "temprah-lab.xyz"
lb_ip4 = "45.32.68.232"