diff options
-rw-r--r-- | clarkzjw.ca/cloudflare.tf | 22 | ||||
-rw-r--r-- | clarkzjw.ca/variables.tf | 4 | ||||
-rw-r--r-- | clarkzjw.ca/versions.tf | 8 |
3 files changed, 16 insertions, 18 deletions
diff --git a/clarkzjw.ca/cloudflare.tf b/clarkzjw.ca/cloudflare.tf index 1a17e3c..68ab88f 100644 --- a/clarkzjw.ca/cloudflare.tf +++ b/clarkzjw.ca/cloudflare.tf | |||
@@ -1,35 +1,21 @@ | |||
1 | terraform { | ||
2 | required_providers { | ||
3 | cloudflare = { | ||
4 | source = "cloudflare/cloudflare" | ||
5 | version = "~> 3.29" | ||
6 | } | ||
7 | } | ||
8 | } | ||
9 | |||
10 | variable "homelab_main_domain" { | ||
11 | description = "HomeLab Main Domain" | ||
12 | default = "clarkzjw.ca" | ||
13 | } | ||
14 | |||
15 | data "cloudflare_zones" "homelab_main_domain" { | 1 | data "cloudflare_zones" "homelab_main_domain" { |
16 | filter { | 2 | filter { |
17 | name = var.homelab_main_domain | 3 | name = var.homelab_main_domain |
18 | } | 4 | } |
19 | } | 5 | } |
20 | 6 | ||
21 | variable "homelab_root" { | 7 | variable "homelab_www_domain" { |
22 | default = "clarkzjw.ca" | 8 | default = "clarkzjw.ca" |
23 | } | 9 | } |
24 | 10 | ||
25 | variable "homelab_root_ip" { | 11 | variable "homelab_www_ip" { |
26 | default = "8.8.8.8" | 12 | default = "8.8.8.8" |
27 | } | 13 | } |
28 | 14 | ||
29 | resource "cloudflare_record" "main" { | 15 | resource "cloudflare_record" "main" { |
30 | zone_id = data.cloudflare_zones.homelab_main_domain.zones[0].id | 16 | zone_id = data.cloudflare_zones.homelab_main_domain.zones[0].id |
31 | name = var.homelab_root | 17 | name = var.homelab_www_domain |
32 | value = var.homelab_root_ip | 18 | value = var.homelab_www_ip |
33 | type = "A" | 19 | type = "A" |
34 | 20 | ||
35 | ttl = 1 | 21 | ttl = 1 |
diff --git a/clarkzjw.ca/variables.tf b/clarkzjw.ca/variables.tf new file mode 100644 index 0000000..2847d76 --- /dev/null +++ b/clarkzjw.ca/variables.tf | |||
@@ -0,0 +1,4 @@ | |||
1 | variable "homelab_main_domain" { | ||
2 | description = "HomeLab Main Domain" | ||
3 | default = "clarkzjw.ca" | ||
4 | } | ||
diff --git a/clarkzjw.ca/versions.tf b/clarkzjw.ca/versions.tf new file mode 100644 index 0000000..1551173 --- /dev/null +++ b/clarkzjw.ca/versions.tf | |||
@@ -0,0 +1,8 @@ | |||
1 | terraform { | ||
2 | required_providers { | ||
3 | cloudflare = { | ||
4 | source = "cloudflare/cloudflare" | ||
5 | version = "~> 3.29" | ||
6 | } | ||
7 | } | ||
8 | } | ||