From 773aa0cb621b474977fb7162e7ab822fb7900c2d Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Thu, 16 Feb 2023 20:24:39 -0800 Subject: [PATCH] terraform dns --- .gitignore | 3 +++ .terraform.lock.hcl | 24 ++++++++++++++++++++++++ main.tf | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 .terraform.lock.hcl create mode 100644 main.tf diff --git a/.gitignore b/.gitignore index 3fa8c86..ae23214 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ .terraform +terraform.tfvars + +domain_records.tf diff --git a/.terraform.lock.hcl b/.terraform.lock.hcl new file mode 100644 index 0000000..f527d0b --- /dev/null +++ b/.terraform.lock.hcl @@ -0,0 +1,24 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/linode/linode" { + version = "1.29.4" + constraints = "1.29.4" + hashes = [ + "h1:pdhSuNr3SQWvHHI+C1zF8J8tJetxGJoCQNxgsg1QHQs=", + "zh:06ccda35d968429a1184aaf981c8104394fa1d719de86b718c56d93c27c1fcd6", + "zh:1fb2497917094e77bde90fe6ee781e20cee739142b891391480c1b3376d81dbb", + "zh:27960e9c07e995aad07a9c5ebfd7fe0304fffd4cb159fd215e82932b798c6d55", + "zh:4ed29807c423c77aab1338972aa1ec3cc16c6b14f4c25c86f4427e8a86bfc467", + "zh:7a39103dc0dc8538f5258d3b64db1e6c91335640763bd05da0478e99748a4949", + "zh:95b3e418e6fcb4b826be9b289a834f1b9893977bd330ac418e0285e56a4644c1", + "zh:ac69c992a5cbaaa6ed9bb65206309ab2c71b5eb17740b7a5295532f9840c67fd", + "zh:ae943e8975075cd9664f00a028838566fdf879c772e518b7adcc82e757916a67", + "zh:b3a85a52489bc3777b5e8c4428b8ea42ae8e0f2398077699c1eb99acea931a34", + "zh:c1a2e945f5691ed97b9cf01351dd3a99c2f9871f172bd71ba0c8a810c75740cd", + "zh:ce86a03d73ee3d2ed58c6fe853cd2a9d0974710d94a0aeb4c195a9d1e78a3481", + "zh:d34afbbf848d8b541a068d64fa04ace13c3bd37ad19fd8b0796662f553ca9652", + "zh:e13b4847098d295cd8216eeec55d940cfc4544672fdc89e0048dd067e69b63f8", + "zh:fc62e9f8fc5d37d28aba2077db10355839cae6d7770eaf8711f97877bac046ab", + ] +} diff --git a/main.tf b/main.tf new file mode 100644 index 0000000..88d7266 --- /dev/null +++ b/main.tf @@ -0,0 +1,37 @@ +terraform { + cloud { + organization = "kejadlen" + workspaces { + name = "boxen" + } + } + + required_providers { + linode = { + source = "linode/linode" + version = "1.29.4" + } + } +} + +variable "soa_email" { + type = string + nullable = false +} + +data "linode_instances" "ramble-hard" { + filter { + name = "label" + values = ["ramble-hard"] + } +} + +locals { + ramble-hard = data.linode_instances.ramble-hard.instances.0 +} + +resource "linode_domain" "kejadlen-dev" { + type = "master" + domain = "kejadlen.dev" + soa_email = var.soa_email +}