aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'jinwei.me/infra/cloudflare.tf')
-rw-r--r--jinwei.me/infra/cloudflare.tf24
1 files changed, 24 insertions, 0 deletions
diff --git a/jinwei.me/infra/cloudflare.tf b/jinwei.me/infra/cloudflare.tf
index aa94568..4f23b40 100644
--- a/jinwei.me/infra/cloudflare.tf
+++ b/jinwei.me/infra/cloudflare.tf
@@ -26,3 +26,27 @@ resource "cloudflare_argo_tunnel" "tunnel" {
26 name = "${var.name}-aws-tunnel" 26 name = "${var.name}-aws-tunnel"
27 secret = random_id.argo_secret.b64_std 27 secret = random_id.argo_secret.b64_std
28} 28}
29
30resource "cloudflare_record" "tunnel_dns" {
31 zone_id = data.cloudflare_zones.domain.zones[0].id
32 name = "next.${var.site_domain}"
33 value = "${cloudflare_argo_tunnel.tunnel.id}.cfargotunnel.com"
34 type = "CNAME"
35 proxied = true
36}
37
38resource "cloudflare_tunnel_config" "tunnel_route" {
39 account_id = var.cloudflare_account_id
40 tunnel_id = cloudflare_argo_tunnel.tunnel.id
41
42 config {
43 ingress_rule {
44 hostname = "next.jinwei.me"
45 path = "/"
46 service = "http://127.0.0.1:30080"
47 }
48 ingress_rule {
49 service = "http_status:404"
50 }
51 }
52}
Powered by cgit v1.2.3 (git 2.41.0)