aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jinwei.me/infra/cloudflare.tf17
-rw-r--r--jinwei.me/infra/variables.tf5
2 files changed, 22 insertions, 0 deletions
diff --git a/jinwei.me/infra/cloudflare.tf b/jinwei.me/infra/cloudflare.tf
index 5d81462..ce1add3 100644
--- a/jinwei.me/infra/cloudflare.tf
+++ b/jinwei.me/infra/cloudflare.tf
@@ -35,6 +35,18 @@ resource "cloudflare_record" "tunnel_dns" {
35 proxied = true 35 proxied = true
36} 36}
37 37
38# TODO
39# since cloudflare terraform provider does not provide an argo tunnel data source
40# refactor this as a separate module?
41# https://registry.terraform.io/providers/cloudflare/cloudflare/3.29.0
42resource "cloudflare_record" "rss_dns" {
43 zone_id = data.cloudflare_zones.domain.zones[0].id
44 name = var.feed_domain
45 value = "${cloudflare_argo_tunnel.tunnel.id}.cfargotunnel.com"
46 type = "CNAME"
47 proxied = true
48}
49
38resource "cloudflare_tunnel_config" "tunnel_route" { 50resource "cloudflare_tunnel_config" "tunnel_route" {
39 account_id = var.cloudflare_account_id 51 account_id = var.cloudflare_account_id
40 tunnel_id = cloudflare_argo_tunnel.tunnel.id 52 tunnel_id = cloudflare_argo_tunnel.tunnel.id
@@ -46,6 +58,11 @@ resource "cloudflare_tunnel_config" "tunnel_route" {
46 service = "http://wordpress:80" 58 service = "http://wordpress:80"
47 } 59 }
48 ingress_rule { 60 ingress_rule {
61 hostname = "feed.jinwei.me"
62 path = "/"
63 service = "http://ttrss:80"
64 }
65 ingress_rule {
49 service = "http_status:404" 66 service = "http_status:404"
50 } 67 }
51 } 68 }
diff --git a/jinwei.me/infra/variables.tf b/jinwei.me/infra/variables.tf
index 87283cc..a3cf8bb 100644
--- a/jinwei.me/infra/variables.tf
+++ b/jinwei.me/infra/variables.tf
@@ -55,6 +55,11 @@ variable "site_domain" {
55 default = "jinwei.me" 55 default = "jinwei.me"
56} 56}
57 57
58variable "feed_domain" {
59 type = string
60 default = "feed.jinwei.me"
61}
62
58variable "s3_cdn_name" { 63variable "s3_cdn_name" {
59 type = string 64 type = string
60 default = "static" 65 default = "static"
Powered by cgit v1.2.3 (git 2.41.0)