parent
40568732df
commit
e87263d962
@ -1 +0,0 @@
|
|||||||
private.tf
|
|
@ -1,29 +1,71 @@
|
|||||||
terraform {
|
terraform {
|
||||||
required_providers {
|
required_providers {
|
||||||
linode = {
|
linode = {
|
||||||
source = "linode/linode"
|
source = "linode/linode"
|
||||||
version = "1.30.0"
|
version = "1.30.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
http = {
|
http = {
|
||||||
source = "hashicorp/http"
|
source = "hashicorp/http"
|
||||||
version = "3.2.1"
|
version = "3.2.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "domain" {
|
||||||
|
type = string
|
||||||
|
nullable = false
|
||||||
|
}
|
||||||
|
|
||||||
data "http" "github_keys" {
|
data "http" "github_keys" {
|
||||||
url = "https://github.com/kejadlen.keys"
|
url = "https://github.com/kejadlen.keys"
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "linode_instance" "lotus_land_story" {
|
resource "linode_instance" "lotus_land_story" {
|
||||||
label = "lotus-land-story"
|
label = "lotus-land-story"
|
||||||
image = "linode/debian11"
|
image = "linode/debian11"
|
||||||
region = "us-west"
|
region = "us-west"
|
||||||
type = "g6-nanode-1"
|
type = "g6-nanode-1"
|
||||||
authorized_keys = split("\n", chomp(data.http.github_keys.response_body))
|
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" {
|
output "lotus_land_story_ip" {
|
||||||
value = resource.linode_instance.lotus_land_story.ip_address
|
value = resource.linode_instance.lotus_land_story.ip_address
|
||||||
}
|
}
|
||||||
|
|
||||||
|
output "lotus_land_story_volume" {
|
||||||
|
value = resource.linode_volume.lotus_land_story.filesystem_path
|
||||||
|
}
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
rss.{{ domain }}
|
||||||
|
reverse_proxy host.docker.internal:8080
|
Loading…
Reference in new issue