Move DNS records to gitea terraform
This commit is contained in:
parent
ca0bc6e5c8
commit
cfde0a0e72
@ -34,44 +34,3 @@ resource "digitalocean_record" "keybase_verification" {
|
||||
ttl = 3600
|
||||
}
|
||||
|
||||
resource "digitalocean_record" "git_mailgun_cname" {
|
||||
domain = digitalocean_domain.jeremydormitzer_com.name
|
||||
type = "CNAME"
|
||||
name = "mail.mg.git"
|
||||
value = "mailgun.org."
|
||||
ttl = 3600
|
||||
}
|
||||
|
||||
resource "digitalocean_record" "git" {
|
||||
domain = digitalocean_domain.jeremydormitzer_com.name
|
||||
type = "A"
|
||||
name = "git"
|
||||
value = data.terraform_remote_state.gitea.outputs.gitea_ip_address
|
||||
ttl = 3600
|
||||
}
|
||||
|
||||
resource "digitalocean_record" "git_mxa" {
|
||||
domain = digitalocean_domain.jeremydormitzer_com.name
|
||||
type = "MX"
|
||||
name = "mg.git"
|
||||
value = "mxa.mailgun.org."
|
||||
priority = 10
|
||||
ttl = 3600
|
||||
}
|
||||
|
||||
resource "digitalocean_record" "git_mxb" {
|
||||
domain = digitalocean_domain.jeremydormitzer_com.name
|
||||
type = "MX"
|
||||
name = "mg.git"
|
||||
value = "mxb.mailgun.org."
|
||||
priority = 10
|
||||
ttl = 3600
|
||||
}
|
||||
|
||||
resource "digitalocean_record" "git_txt" {
|
||||
domain = digitalocean_domain.jeremydormitzer_com.name
|
||||
type = "TXT"
|
||||
name = "mx._domainkey.mg.git"
|
||||
value = "\"k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCpGHgB9oj3UdxdGUp9389PihevWCs+YKdkXv+C9DRv7nXY+L1bGjgqooIXwW9Bte5QC9lFpCN81NzK95gDYkX9rgo+huaeSw2B4slGBBWIBet4Wk6OafcQ2LsT9/VFUYeFyKD8AF4hV44CC5ZSWYVC6TiYCrNhEscQo9OYBhKicwIDAQAB\""
|
||||
ttl = 3600
|
||||
}
|
||||
|
@ -1,3 +1,7 @@
|
||||
output "jeremydormitzer_com_urn" {
|
||||
value = digitalocean_domain.jeremydormitzer_com.urn
|
||||
}
|
||||
|
||||
output "jeremydormitzer_com_name" {
|
||||
value = digitalocean_domain.jeremydormitzer_com.name
|
||||
}
|
||||
|
14
prod/gitea/terraform/data.tf
Normal file
14
prod/gitea/terraform/data.tf
Normal file
@ -0,0 +1,14 @@
|
||||
data "terraform_remote_state" "do_jeremydormitzer_com" {
|
||||
backend = "s3"
|
||||
|
||||
config = {
|
||||
skip_credentials_validation = true
|
||||
skip_metadata_api_check = true
|
||||
access_key = var.spaces_access_id
|
||||
secret_key = var.spaces_secret_key
|
||||
region = "us-east-1"
|
||||
endpoint = "nyc3.digitaloceanspaces.com"
|
||||
bucket = "jdormit-tf-state"
|
||||
key = "mgmt/do-jeremydormitzer-com.tfstate"
|
||||
}
|
||||
}
|
@ -30,3 +30,45 @@ resource "digitalocean_volume_attachment" "gitea" {
|
||||
droplet_id = module.packer_droplet.droplet_id
|
||||
volume_id = digitalocean_volume.gitea_volume.id
|
||||
}
|
||||
|
||||
resource "digitalocean_record" "git_mailgun_cname" {
|
||||
domain = data.terraform_remote_state.do_jeremydormitzer_com.outputs.jeremydormitzer_com_name
|
||||
type = "CNAME"
|
||||
name = "mail.mg.git"
|
||||
value = "mailgun.org."
|
||||
ttl = 3600
|
||||
}
|
||||
|
||||
resource "digitalocean_record" "git" {
|
||||
domain = data.terraform_remote_state.do_jeremydormitzer_com.outputs.jeremydormitzer_com_name
|
||||
type = "A"
|
||||
name = "git"
|
||||
value = module.packer_droplet.droplet_ip_address
|
||||
ttl = 3600
|
||||
}
|
||||
|
||||
resource "digitalocean_record" "git_mxa" {
|
||||
domain = data.terraform_remote_state.do_jeremydormitzer_com.outputs.jeremydormitzer_com_name
|
||||
type = "MX"
|
||||
name = "mg.git"
|
||||
value = "mxa.mailgun.org."
|
||||
priority = 10
|
||||
ttl = 3600
|
||||
}
|
||||
|
||||
resource "digitalocean_record" "git_mxb" {
|
||||
domain = data.terraform_remote_state.do_jeremydormitzer_com.outputs.jeremydormitzer_com_name
|
||||
type = "MX"
|
||||
name = "mg.git"
|
||||
value = "mxb.mailgun.org."
|
||||
priority = 10
|
||||
ttl = 3600
|
||||
}
|
||||
|
||||
resource "digitalocean_record" "git_txt" {
|
||||
domain = data.terraform_remote_state.do_jeremydormitzer_com.outputs.jeremydormitzer_com_name
|
||||
type = "TXT"
|
||||
name = "mx._domainkey.mg.git"
|
||||
value = "\"k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCpGHgB9oj3UdxdGUp9389PihevWCs+YKdkXv+C9DRv7nXY+L1bGjgqooIXwW9Bte5QC9lFpCN81NzK95gDYkX9rgo+huaeSw2B4slGBBWIBet4Wk6OafcQ2LsT9/VFUYeFyKD8AF4hV44CC5ZSWYVC6TiYCrNhEscQo9OYBhKicwIDAQAB\""
|
||||
ttl = 3600
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user