diff --git a/backend/main.tf b/backend/main.tf index 21bd350..c1df808 100644 --- a/backend/main.tf +++ b/backend/main.tf @@ -71,22 +71,15 @@ output "cdn_origin" { value = digitalocean_cdn.distrust_co.origin } -# # Handle record for distrust.co -# resource "digitalocean_record" "distrust_co-cdn" { -# domain = digitalocean_domain.default.name -# type = "CNAME" -# name = "@" -# value = "${digitalocean_cdn.distrust_co.origin}." -# depends_on = [ -# digitalocean_cdn.distrust_co -# ] -# } - -resource "digitalocean_record" "CNAME-www" { +# Handle record for distrust.co +resource "digitalocean_record" "distrust_co-cdn" { domain = digitalocean_domain.default.name type = "CNAME" - name = "www-main" - value = "@" + name = "@" + value = "${digitalocean_cdn.distrust_co.origin}." + depends_on = [ + digitalocean_cdn.distrust_co + ] } # NameCheap Records @@ -106,16 +99,16 @@ resource "digitalocean_record" "billing" { resource "digitalocean_record" "chat" { domain = digitalocean_domain.default.id - type = "A" + type = "CNAME" name = "chat" - value = "143.198.235.76" + value = "distrust.element.io." } resource "digitalocean_record" "www" { domain = digitalocean_domain.default.id - type = "A" + type = "CNAME" name = "www" - value = "143.198.235.76" + value = "${digitalocean_domain.default.id}." } # Mail records