Compare commits

...

7 Commits

10 changed files with 43 additions and 12 deletions

View File

@@ -0,0 +1,3 @@
data "linode_domain" "this" {
domain = var.domain_name
}

View File

@@ -1,4 +1,3 @@
output "instance" {
value = linode_instance.this
}

View File

@@ -0,0 +1,6 @@
resource "linode_domain_record" "this_ipv4" {
domain_id = data.linode_domain.this.id
name = var.host_name
record_type = "A"
target = linode_instance.this.ip_address
}

View File

@@ -0,0 +1,6 @@
resource "linode_domain_record" "this_ipv6" {
domain_id = data.linode_domain.this.id
name = var.host_name
record_type = "AAAA"
target = element(split("/", linode_instance.this.ipv6), 0)
}

View File

@@ -1,11 +1,12 @@
resource "linode_instance" "this" {
authorized_keys = var.authorized_keys
backups_enabled = true
booted = true
label = "${var.host_name}.${var.domain_name}"
image = var.image
private_ip = true
tags = var.tags
type = var.type
region = var.region
authorized_keys = var.authorized_keys
backups_enabled = var.backups_enabled
booted = var.booted
label = "${var.host_name}.${var.domain_name}"
image = var.image
private_ip = var.private_ip
tags = var.tags
type = var.type
region = var.region
watchdog_enabled = var.watchdog_enabled
}

View File

@@ -2,8 +2,8 @@ terraform {
required_providers {
linode = {
source = "linode/linode"
version = ">= 1.27.2"
version = ">= 1.29.4"
}
}
required_version = ">= 1.2.1"
required_version = ">= 1.3.6"
}

View File

@@ -0,0 +1,4 @@
variable "backups_enabled" {
default = true
type = bool
}

4
variable.booted.tf Normal file
View File

@@ -0,0 +1,4 @@
variable "booted" {
default = true
type = bool
}

4
variable.private_ip.tf Normal file
View File

@@ -0,0 +1,4 @@
variable "private_ip" {
default = true
type = bool
}

View File

@@ -0,0 +1,4 @@
variable "watchdog_enabled" {
default = true
type = bool
}