You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
1.5 KiB
72 lines
1.5 KiB
terraform {
|
|
required_providers {
|
|
linode = {
|
|
source = "linode/linode"
|
|
version = "1.30.0"
|
|
}
|
|
|
|
http = {
|
|
source = "hashicorp/http"
|
|
version = "3.2.1"
|
|
}
|
|
}
|
|
}
|
|
|
|
variable "domain" {
|
|
type = string
|
|
nullable = false
|
|
}
|
|
|
|
data "http" "github_keys" {
|
|
url = "https://github.com/kejadlen.keys"
|
|
}
|
|
|
|
resource "linode_instance" "lotus_land_story" {
|
|
label = "lotus-land-story"
|
|
image = "linode/debian11"
|
|
region = "us-west"
|
|
type = "g6-nanode-1"
|
|
authorized_keys = split("\n", chomp(data.http.github_keys.response_body))
|
|
}
|
|
|
|
resource "linode_volume" "lotus_land_story" {
|
|
# count = 0
|
|
|
|
label = "lotus-land-story"
|
|
region = "us-west"
|
|
linode_id = linode_instance.lotus_land_story.id
|
|
size = 10
|
|
|
|
connection {
|
|
host = resource.linode_instance.lotus_land_story.ip_address
|
|
}
|
|
|
|
provisioner "remote-exec" {
|
|
inline = [
|
|
"mkfs.ext4 '${self.filesystem_path}'",
|
|
"mkdir '/mnt/lotus-land-story'",
|
|
"mount '${self.filesystem_path}' '/mnt/lotus-land-story'",
|
|
]
|
|
}
|
|
}
|
|
|
|
data "linode_domain" "domain" {
|
|
domain = var.domain
|
|
}
|
|
|
|
resource "linode_domain_record" "rww" {
|
|
domain_id = data.linode_domain.domain.id
|
|
name = "rss"
|
|
record_type = "A"
|
|
target = resource.linode_instance.lotus_land_story.ip_address
|
|
}
|
|
|
|
|
|
output "lotus_land_story_ip" {
|
|
value = resource.linode_instance.lotus_land_story.ip_address
|
|
}
|
|
|
|
output "lotus_land_story_volume" {
|
|
value = resource.linode_volume.lotus_land_story.filesystem_path
|
|
}
|