Created
July 5, 2023 15:22
-
-
Save istarkov/9431c0897063cf5120817e69bfc7a8aa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Intent to test n8n endpoints locally | |
resource "random_id" "playground_tunnel_secret" { | |
byte_length = 35 | |
} | |
resource "cloudflare_tunnel" "playground" { | |
provider = cloudflare.main | |
account_id = local.cloudflare_account_id | |
name = "playground" | |
secret = random_id.playground_tunnel_secret.b64_std | |
} | |
resource "cloudflare_record" "playground" { | |
provider = cloudflare.main | |
name = "wstd-sys-playground" | |
zone_id = data.cloudflare_zone.wstd_work.zone_id | |
value = "${cloudflare_tunnel.playground.id}.cfargotunnel.com" | |
type = "CNAME" | |
proxied = true | |
} | |
output "tunnel_token" { | |
value = <<-EOT | |
Execute locally | |
cloudflared tunnel --no-autoupdate --url localhost:8787 run --token ${nonsensitive(cloudflare_tunnel.playground.tunnel_token)} | |
then access through wstd-sys-playground.wstd.work to localhost:8787 | |
EOT | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment