Add ttl to the DNS records
Signed-off-by: Jason Rothstein <fdragon@fdragon.org>
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
data "digitalocean_domain" "this" {
|
data "digitalocean_domain" "this" {
|
||||||
name = var.domain_name
|
name = var.domain_name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ data "digitalocean_project" "this" {
|
|||||||
count = var.use_project > 0 ? 1 : 0
|
count = var.use_project > 0 ? 1 : 0
|
||||||
name = var.project
|
name = var.project
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ data "digitalocean_vpc" "this" {
|
|||||||
count = var.use_vpc > 0 ? 1 : 0
|
count = var.use_vpc > 0 ? 1 : 0
|
||||||
name = var.vpc_name
|
name = var.vpc_name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
output "droplet" {
|
output "droplet" {
|
||||||
value = digitalocean_droplet.this
|
value = digitalocean_droplet.this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,3 +20,4 @@ resource "digitalocean_droplet" "this" {
|
|||||||
tags = var.tags
|
tags = var.tags
|
||||||
vpc_uuid = var.use_vpc > 0 ? data.digitalocean_vpc.this[0].id : null
|
vpc_uuid = var.use_vpc > 0 ? data.digitalocean_vpc.this[0].id : null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,3 +5,4 @@ resource "digitalocean_project_resources" "this" {
|
|||||||
digitalocean_droplet.this.urn
|
digitalocean_droplet.this.urn
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
resource "digitalocean_record" "A" {
|
resource "digitalocean_record" "A" {
|
||||||
domain = data.digitalocean_domain.this.name
|
domain = data.digitalocean_domain.this.name
|
||||||
name = var.host_name
|
name = var.host_name
|
||||||
|
ttl = "300"
|
||||||
type = "A"
|
type = "A"
|
||||||
value = digitalocean_droplet.this.ipv4_address
|
value = digitalocean_droplet.this.ipv4_address
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
resource "digitalocean_record" "AAAA" {
|
resource "digitalocean_record" "AAAA" {
|
||||||
domain = data.digitalocean_domain.this.name
|
domain = data.digitalocean_domain.this.name
|
||||||
name = var.host_name
|
name = var.host_name
|
||||||
|
ttl = "300"
|
||||||
type = "AAAA"
|
type = "AAAA"
|
||||||
value = digitalocean_droplet.this.ipv6_address
|
value = digitalocean_droplet.this.ipv6_address
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,3 +5,4 @@ resource "digitalocean_volume" "this" {
|
|||||||
region = var.region
|
region = var.region
|
||||||
size = var.volume_size
|
size = var.volume_size
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,3 +3,4 @@ resource "digitalocean_volume_attachment" "this" {
|
|||||||
droplet_id = digitalocean_droplet.this.id
|
droplet_id = digitalocean_droplet.this.id
|
||||||
volume_id = digitalocean_volume.this[0].id
|
volume_id = digitalocean_volume.this[0].id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,3 +3,4 @@ variable "backup_policy_hour" {
|
|||||||
default = "0"
|
default = "0"
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,3 +3,4 @@ variable "backup_policy_plan" {
|
|||||||
default = "weekly"
|
default = "weekly"
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,3 +3,4 @@ variable "backup_policy_weekday" {
|
|||||||
default = "SUN"
|
default = "SUN"
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ variable "domain_name" {
|
|||||||
default = "example.com"
|
default = "example.com"
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ variable "host_name" {
|
|||||||
default = "hello-world"
|
default = "hello-world"
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ variable "image_name" {
|
|||||||
default = "fedora-42-x64"
|
default = "fedora-42-x64"
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ variable "project" {
|
|||||||
default = "default"
|
default = "default"
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ variable "region" {
|
|||||||
default = "nyc3"
|
default = "nyc3"
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ variable "size" {
|
|||||||
default = "s-1vcpu-1gb"
|
default = "s-1vcpu-1gb"
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
variable "ssh_keys" {
|
variable "ssh_keys" {
|
||||||
type = list(any)
|
type = list(any)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ variable "tags" {
|
|||||||
default = []
|
default = []
|
||||||
type = list(string)
|
type = list(string)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ variable "use_project" {
|
|||||||
default = 0
|
default = 0
|
||||||
type = number
|
type = number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ variable "use_volume" {
|
|||||||
default = 0
|
default = 0
|
||||||
type = number
|
type = number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ variable "use_vpc" {
|
|||||||
default = 0
|
default = 0
|
||||||
type = number
|
type = number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ variable "volume_size" {
|
|||||||
default = 0
|
default = 0
|
||||||
type = number
|
type = number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ variable "vpc_name" {
|
|||||||
default = "nyc3"
|
default = "nyc3"
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user