76 lines
2.4 KiB
HCL
76 lines
2.4 KiB
HCL
provider "digitalocean" {
|
|
token = var.do_token
|
|
spaces_access_id = var.spaces_access_id
|
|
spaces_secret_key = var.spaces_secret_key
|
|
}
|
|
|
|
module "packer_droplet" {
|
|
source = "../../../terraform-modules/packer_droplet"
|
|
name = "gitea"
|
|
do_token = var.do_token
|
|
spaces_access_id = var.spaces_access_id
|
|
spaces_secret_key = var.spaces_secret_key
|
|
droplet_size = "s-1vcpu-1gb-intel"
|
|
}
|
|
|
|
resource "digitalocean_volume" "gitea_volume" {
|
|
name = "gitea-volume"
|
|
description = "The volume to hold Gitea repositories and data"
|
|
region = "nyc1"
|
|
size = 20
|
|
initial_filesystem_label = "gitea-volume"
|
|
initial_filesystem_type = "ext4"
|
|
tags = ["terraform"]
|
|
|
|
lifecycle {
|
|
prevent_destroy = true
|
|
}
|
|
}
|
|
|
|
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
|
|
}
|