Compare commits
4 Commits
d483f5ed72
...
c50deddf53
Author | SHA1 | Date | |
---|---|---|---|
c50deddf53 | |||
6ab49d1b28 | |||
68acbe2842 | |||
a6dc2da7be |
@ -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
34
infra/dns/build.sh
Normal 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
|
@ -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
|
|
||||||
}
|
|
||||||
|
|
@ -36,8 +36,10 @@ locals {
|
|||||||
},
|
},
|
||||||
{ name = "www.shockrah.xyz", records = [ var.vultr_host ] },
|
{ name = "www.shockrah.xyz", records = [ var.vultr_host ] },
|
||||||
{ 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.19.0"
|
version = "2.22.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,10 @@ 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,8 +37,3 @@ 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.30.0+1"
|
version = "v1.31.2+1"
|
||||||
pool = {
|
pool = {
|
||||||
plan = "vc2-1c-2gb"
|
plan = "vc2-1c-2gb"
|
||||||
autoscale = true
|
autoscale = true
|
||||||
@ -12,7 +12,3 @@ 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