Skip to content
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

Cloudflare Tunnel warp_routing issues - plan need to be applied twice #2233

Closed
2 tasks done
calderonth opened this issue Feb 10, 2023 · 7 comments
Closed
2 tasks done
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log.

Comments

@calderonth
Copy link

calderonth commented Feb 10, 2023

Confirmation

  • My issue isn't already found on the issue tracker.
  • I have replicated my issue using the latest version of the provider and it is still present.

Terraform and Cloudflare provider version

registry.terraform.io/cloudflare/cloudflare v3.34.0

Affected resource(s)

cloudflare_tunnel_config

Terraform configuration files

resource "cloudflare_argo_tunnel" "tunnel" {
  account_id = var.cloudflare_account_id
  name = "test_tunnel"
  secret = "REDACTED"
}

resource "cloudflare_tunnel_config" "tunnel_test" {
  account_id = var.cloudflare_account_id
  tunnel_id = cloudflare_argo_tunnel.tunnel.id

  config {
    ingress_rule {
      service = "http://127.0.0.1:8080"
      hostname = "tunnel.${var.cloudflare_zone}"
    }
    warp_routing {
      enabled = false
    }
  }
}

resource "cloudflare_record" "tunnel_cname" {
  zone_id = var.cloudflare_zone_id
  name = "tunnel"
  value = "${cloudflare_argo_tunnel.tunnel.id}.cfargotunnel.com"
  type = "CNAME"
  proxied = true
}

Link to debug output

https://gist.github.com/calderonth/1eeed1c19592b9c2955bba78d661adf7

Panic output

No response

Expected output

The plan/apply should correctly set the warp_routing values on the first pass.
It sends an empty JSON structure on the first pass which results results in a broken configuration (no data routed throught the tunnel).

Running a second time the apply actually fills out the the warp_routing structure and the tunnel configuration is set accordingly.

Actual output

The plan shows it has applied successfully on the first apply when it hasn't.

Steps to reproduce

  1. Adapt the configuration provided
  2. Run terraform apply
  3. Run terraform plan after and observe that the warp_routing setting still needs applying

Additional factoids

I have also tried to remove the warp_routing section as it is supposed to be optional but that also results in an unusable tunnel when created from TF.

References

No response

@calderonth calderonth added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 10, 2023
@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions
Copy link

github-actions bot commented Feb 10, 2023

Terraform debug log detected ✅

@github-actions github-actions bot added triage/needs-information Indicates an issue needs more information in order to work on it. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 10, 2023
@calderonth
Copy link
Author

I have updated the TF_LOG to point to a full Terraform run.

@github-actions github-actions bot added triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log. and removed triage/needs-information Indicates an issue needs more information in order to work on it. labels Feb 10, 2023
@jacobbednarz
Copy link
Member

this issue is related to sending zero values in Terraform where it cannot differentiate the two in state (hence two runs fix it).

i don't have an ETA on this but we have a larger body of work that is tracking zero values across the provider and i'll note this one against that.

@Ancitik
Copy link

Ancitik commented May 4, 2023

Since Cloudflare Enterprise Support redirect to this issue could we have any update please.

Thanks.

@algo7
Copy link

algo7 commented May 21, 2023

Do you happen to have any news on this one?

@obezuk
Copy link

obezuk commented Jun 1, 2023

This is no longer an issue and can be closed. It has been addressed within the Cloudflare Tunnel's API service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log.
Projects
None yet
Development

No branches or pull requests

5 participants