-
Notifications
You must be signed in to change notification settings - Fork 630
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_route
broken imports and reads
#1611
Comments
Thank you for reporting this issue! For maintainers to dig into issues it is required that all issues include the entirety of This issue has been marked with |
cloudflare_tunnel_route
broken imports and reads
can you please provide the full TF_LOG=DEBUG out per the issue template? https://jacobbednarz.com/tf-log-redactor/ will redact the sensitive information for you irrespective of the log size. as for the payload body vs params, that has already been addressed via cloudflare/cloudflare-go#873 and was included in v0.39.0 which should make the upcoming release of the provider next week. |
Sorry about that -- I'm encountering this issue in a large enough terraform project that the full output is quite large and features lots of sensitive information not covered by your tool. Fallible as I am, I don't trust myself to properly redact everything perfectly while leaving the output in a trustworthy, helpful state for debugging. That said I think it's pretty clear what the issue is, and I'm glad an upstream change is landing to correct it. If you'd still like a full debug output, I can spin up a demo cloudflare account / project and hand you a minimally reproducible example; alternatively I'm happy closing this and trusting that the SDK update will fix it. |
Thanks folks, it looks like bumping to provider |
Confirmation
Terraform and Cloudflare provider version
Terraform v0.12.31
Affected resource(s)
Terraform configuration files
Debug output
Sorry, I'm eliding non-relevant parts of the debug output (there's too much to redact):
Panic output
No response
Expected output
I expect to be able to import a
cloudflare_tunnel_route
resource and have it associate with the correct route in Cloudflare's API. Then, once created or imported, I expect a plan or apply to deterministically resolve the correct route in Cloudflare's API, and yield expected diffs.Actual output
When importing a
cloudflare_tunnel_route
resource, the operation can claim success when in fact it associated the resource with the wrong entity in Cloudflare's API. Similarly, when planning or applying an already importedcloudflare_tunnel_route
, reading the entity from Cloudflare's API will non-deterministically return the wrong value and yield an incorrect diff.Steps to reproduce
cloudflare_tunnel_route
and then delete it. It should be "soft deleted" in Cloudflare's API.cloudflare_tunnel_route
.terraform plan
. Spuriously, the route deleted in step (1) will be associated with the one in step (2) and yield an incorrect plan.Additional factoids
I believe the root cause here is this provider, via the Cloudflare Go SDK, making an improper request to Cloudflare's API when pulling the list of account-scoped tunnel routes.
The API docs suggest we make the following request for the list:
Specifically, filter parameters ought to be added to the URL querystring.
In actuality, as the debug output here suggests, we're attaching filter parameters in a json request body, which the API ignores:
terraform-provider-cloudflare/cloudflare/resource_cloudflare_tunnel_route.go
Lines 33 to 38 in 2b259f3
https://github.com/cloudflare/cloudflare-go/blob/be41d9e8747c047c8b91993faa3f54c13ee6e0b7/tunnel_routes.go#L73-L92
References
The text was updated successfully, but these errors were encountered: