chore(terraform): update DNS records
This commit is contained in:
+11
-2
@@ -56,9 +56,18 @@ locals {
|
||||
}
|
||||
|
||||
# Publish the VPS IP as a Cloudflare A record
|
||||
resource "cloudflare_dns_record" "a" {
|
||||
resource "cloudflare_dns_record" "domain" {
|
||||
zone_id = data.cloudflare_zone.zone.id
|
||||
name = var.record_name
|
||||
name = "@"
|
||||
type = "A"
|
||||
content = local.public_ip
|
||||
proxied = var.cloudflare_proxied
|
||||
ttl = var.cloudflare_proxied ? 1 : 3600
|
||||
}
|
||||
|
||||
resource "cloudflare_dns_record" "subdomain" {
|
||||
zone_id = data.cloudflare_zone.zone.id
|
||||
name = "*"
|
||||
type = "A"
|
||||
content = local.public_ip
|
||||
proxied = var.cloudflare_proxied
|
||||
|
||||
@@ -4,7 +4,6 @@ hcloud_server_type = "cx23"
|
||||
hcloud_image = "debian-13"
|
||||
hcloud_location = "nbg1"
|
||||
|
||||
record_name = "dokploy"
|
||||
cloudflare_proxied = true
|
||||
|
||||
# Note: Use file() to easily read your local SSH public key
|
||||
|
||||
@@ -45,12 +45,6 @@ variable "domain_name" {
|
||||
description = "Cloudflare zone (apex domain) in which to create the A record"
|
||||
}
|
||||
|
||||
variable "record_name" {
|
||||
type = string
|
||||
description = "DNS record name relative to the zone; use \"@\" for the apex"
|
||||
default = "dokploy"
|
||||
}
|
||||
|
||||
variable "cloudflare_proxied" {
|
||||
type = bool
|
||||
description = "Whether Cloudflare should proxy (orange-cloud) the A record"
|
||||
|
||||
Reference in New Issue
Block a user