Compare commits
No commits in common. "c50deddf5391848b776ad9f0dcb55827d7b1b594" and "d483f5ed7281106c78cbb70884a0d385ab3356ae" have entirely different histories.
c50deddf53
...
d483f5ed72
24
infra/dns/Makefile
Normal file
24
infra/dns/Makefile
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
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
|
@ -1,34 +0,0 @@
|
|||||||
#!/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
|
|
49
infra/dns/project-athens-xyz.tf
Normal file
49
infra/dns/project-athens-xyz.tf
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
#############################
|
||||||
|
# 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
|
||||||
|
}
|
||||||
|
|
@ -38,8 +38,6 @@ locals {
|
|||||||
{ name = "resume.shockrah.xyz", records = [ var.vultr_host ] },
|
{ name = "resume.shockrah.xyz", records = [ var.vultr_host ] },
|
||||||
{ name = "immich.shockrah.xyz", records = [ "45.32.92.196" ] },
|
{ name = "immich.shockrah.xyz", records = [ "45.32.92.196" ] },
|
||||||
{ name = "git.shockrah.xyz", records = [ var.vultr_host ] },
|
{ 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" ] }
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ terraform {
|
|||||||
}
|
}
|
||||||
vultr = {
|
vultr = {
|
||||||
source = "vultr/vultr"
|
source = "vultr/vultr"
|
||||||
version = "2.22.1"
|
version = "2.19.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,10 +15,6 @@ deploy_plan() {
|
|||||||
terraform apply $plan
|
terraform apply $plan
|
||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
|
||||||
terraform init
|
|
||||||
}
|
|
||||||
|
|
||||||
help_prompt() {
|
help_prompt() {
|
||||||
cat <<- EOF
|
cat <<- EOF
|
||||||
Options: plan deploy help
|
Options: plan deploy help
|
||||||
|
@ -37,3 +37,8 @@ variable cluster {
|
|||||||
variable lab_domain {
|
variable lab_domain {
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable lb_ip4 {
|
||||||
|
type = string
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
cluster = {
|
cluster = {
|
||||||
region = "lax"
|
region = "lax"
|
||||||
label = "athens-cluster"
|
label = "athens-cluster"
|
||||||
version = "v1.31.2+1"
|
version = "v1.30.0+1"
|
||||||
pool = {
|
pool = {
|
||||||
plan = "vc2-1c-2gb"
|
plan = "vc2-1c-2gb"
|
||||||
autoscale = true
|
autoscale = true
|
||||||
@ -12,3 +12,7 @@ cluster = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lab_domain = "temprah-lab.xyz"
|
lab_domain = "temprah-lab.xyz"
|
||||||
|
|
||||||
|
lb_ip4 = "45.32.68.232"
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user