Compare commits
10 Commits
2022-05-08
...
2022-07-03
Author | SHA1 | Date | |
---|---|---|---|
502a17f145 | |||
5746be68e4 | |||
21bacbe714 | |||
883538a97a | |||
490b2279b4 | |||
ed8e4a55c4 | |||
3e74388f97 | |||
fb12a159a4 | |||
a2b268c889 | |||
35c3b1c0bf |
3
data.linode_domain.this.tf
Normal file
3
data.linode_domain.this.tf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
data "linode_domain" "this" {
|
||||||
|
domain = var.domain_name
|
||||||
|
}
|
@@ -1,4 +1,3 @@
|
|||||||
output "instance" {
|
output "instance" {
|
||||||
value = linode_instance.this
|
value = linode_instance.this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,11 +0,0 @@
|
|||||||
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
|
|
||||||
}
|
|
6
resource.linode_domain_record.this_ipv4.tf
Normal file
6
resource.linode_domain_record.this_ipv4.tf
Normal 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
|
||||||
|
}
|
6
resource.linode_domain_record.this_ipv6.tf
Normal file
6
resource.linode_domain_record.this_ipv6.tf
Normal 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)
|
||||||
|
}
|
12
resource.linode_instance.this.tf
Normal file
12
resource.linode_instance.this.tf
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
resource "linode_instance" "this" {
|
||||||
|
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
|
||||||
|
}
|
@@ -2,8 +2,8 @@ terraform {
|
|||||||
required_providers {
|
required_providers {
|
||||||
linode = {
|
linode = {
|
||||||
source = "linode/linode"
|
source = "linode/linode"
|
||||||
version = ">= 1.27.1"
|
version = ">= 1.28.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
required_version = ">= 1.1.9"
|
required_version = ">= 1.2.4"
|
||||||
}
|
}
|
||||||
|
4
variable.backups_enabled.tf
Normal file
4
variable.backups_enabled.tf
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
variable "backups_enabled" {
|
||||||
|
default = true
|
||||||
|
type = bool
|
||||||
|
}
|
4
variable.booted.tf
Normal file
4
variable.booted.tf
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
variable "booted" {
|
||||||
|
default = true
|
||||||
|
type = bool
|
||||||
|
}
|
@@ -1,4 +1,4 @@
|
|||||||
variable "image" {
|
variable "image" {
|
||||||
default = "linode/fedora35"
|
default = "linode/fedora36"
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
4
variable.private_ip.tf
Normal file
4
variable.private_ip.tf
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
variable "private_ip" {
|
||||||
|
default = true
|
||||||
|
type = bool
|
||||||
|
}
|
4
variable.watchdog_enabled.tf
Normal file
4
variable.watchdog_enabled.tf
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
variable "watchdog_enabled" {
|
||||||
|
default = true
|
||||||
|
type = bool
|
||||||
|
}
|
Reference in New Issue
Block a user