-
Notifications
You must be signed in to change notification settings - Fork 609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: cloudflare_tunnel_config resource #1756
Comments
at this stage, i'm not sure if we'll put the configuration properties on this resource or a new resource all together as they are separate endpoints. i'd recommend updating this issue to purely track the addition of the configuration resource as the other points are already covered by other issues. |
I agree with making this a separate resource. I also didn't realize #1646 had plans to rename the resource. Also, while cloudflare-go updated the argo tunnel functions to the new API endpoint, it may still be in our best interest to update the function references here to point at the new tunnel functions and avoid library-level deprecations: https://github.com/cloudflare/terraform-provider-cloudflare/blob/master/internal/provider/resource_cloudflare_argo_tunnel.go#L35 |
It gets quite confusing when i try to use Right after manual migration to a managed tunnel via UI everything starts working, including private network routes previously configured via Terraform. Also, the same "local" tunnel gets created when i try to use "new" API directly: https://api.cloudflare.com/#cloudflare-tunnel-create-cloudflare-tunnel TL;DR - |
@hatemosphere This is exactly what i'm hoping to get solved with this resource. Cloudflare tunnels are not "remote managed" until configuration is PUT at Currently, the |
I am evaluating Terraform managed Cloudflare Tunnels for exposing Kubernetes workloads. It would be really nice to be able to create Subscribing for future updates. |
Is there any update on when this will be implemented? I'm struggling to figure out how to add |
I assume this is referring to the I've been doing some unpleasant workarounds for these issues by using the |
As a related aside, it would be nice if, at a minimum, the documentation would be updated to reflect the manual migration step, and the fact that one must either do this manual migration in the UI or find a way to automate the provisioning of a cloudflared config.yml with ingress rules. Non-inclusive list of documentation locations that should mention this:
A clearer description in the docs would have saved me -- and I'm sure someone else -- a lot of headache. |
Is there any update on when we will be able to set the public hostnames for a cloudflare tunnel using terraform? In the meantime, I'm struggling to know if there's another way to do this. Currently does it have to be done manually in the ZeroTrust dashboard? Or can I use a config file on the server to manage the public hostnames for a tunnel? A bit of context, I'm running Help appreciated. |
@elev8studio -- you can set the public hostnames using Terraform. You just can't configure the tunnel client as to what you want the hostnames to do. (i.e. the Ingress rules in /etc/cloudflared/config.yml) I automated the process of creating tunnels by
|
@mmllc-jsilverman Yep, you're right. It's the last step that I want to be able to do with Terraform. Hopefully they'll make it possible before too long. Would you mind sharing the shell scripts in a gist with the details of your last 2 steps? I want to automate as much as possible. I'm also running cloudflared as a docker container with docker compose. Any support you can give would be greatly appreciated. |
@elev8studio sure... https://gist.github.com/mmllc-jsilverman/2c8a363134d10e55fdccda27ec68dcd8 You will obviously have to change some things to suit your environment |
@mmllc-jsilverman Thanks very much! Please can you explain how you use this script in your automation flow? It might help me determine my course of action. Please can you clarify the mapping of the variables in your script to the Terraform output, specifically the Thanks for your help! |
The script is part of the provisioner for the VM on which it runs. For docker, it would be a series of RUN statements in the Dockerfile. As far as those variables, there are a variety of ways to inject variables into an automation workflow. Some of the values are things that have to be provided on instantiation. I used Terraform templatefile() and injected the script into the GCP metadata startup. https://developer.hashicorp.com/terraform/language/functions/templatefile |
This functionality has been released in v3.29.0 of the Terraform Cloudflare Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
Thanks for this. Can you use like for example supporting the following origin configuration for
Do I need to maintain a CC @Cyb3r-Jak3 |
So it does not look like the API offers a (public) way to set |
Thanks @Cyb3r-Jak3. Makes sense. I have opened issues/2072. |
Current Terraform and Cloudflare provider version
latest as of writing this issue
Description
This resource should accompany the existing
cloudflare_argo_tunnel
resource (orcloudflare_tunnel
once renamed by #1646)The new cfd_tunnel api supported by cloudflare-go's
Tunnel
api includes the all-new Tunnel Configuration API now implemented by cloudflare-go#948Use cases
Goal: In this resource, terraform should be able to configure the new cloudflared tunnels using the latest remote configuration API
Potential Terraform configuration
References
The text was updated successfully, but these errors were encountered: