-
Notifications
You must be signed in to change notification settings - Fork 734
Description
Confirmation
- This is a bug with an existing resource and is not a feature request or enhancement. Feature requests should be submitted with Cloudflare Support or your account team.
- I have searched the issue tracker and my issue isn't already found.
- I have replicated my issue using the latest version of the provider and it is still present.
Terraform and Cloudflare provider version
Versions below. I recently upgraded to 5.9.0
as I was having the same issues on 5.8.4
.
$ terraform version
Terraform v1.13.1
on linux_amd64
$ terraform init
Initializing the backend...
Initializing provider plugins...
- Reusing previous version of cloudflare/cloudflare from the dependency lock file
- Using previously-installed cloudflare/cloudflare v5.9.0
Terraform has been successfully initialized!
Affected resource(s)
- cloudflare_zero_trust_tunnel_warp_connector
Terraform configuration files
import {
to = cloudflare_zero_trust_tunnel_warp_connector.importexample
id = "1234obfuscatedaccountid1234/1234obfuscatedtunneluuid1234"
}
resource "cloudflare_zero_trust_tunnel_warp_connector" "importexample" {
account_id = cloudflare_account.management.id
name = "WARP IMPORT EXAMPLE"
}
resource "cloudflare_zero_trust_tunnel_warp_connector" "newexample" {
account_id = cloudflare_account.management.id
name = "WARP NEW EXAMPLE"
}
Link to debug output
https://gist.github.com/yamjoepobuda/620ac24e26c99970652d230dd663c235
Panic output
╷
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to cloudflare_zero_trust_tunnel_warp_connector.terraform_test, provider "provider["registry.terraform.io/cloudflare/cloudflare"]" produced an unexpected new value: .config_src: was
│ cty.StringVal("local"), but now null.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵
╷
│ Error: failed to make http request
│
│ with cloudflare_zero_trust_tunnel_warp_connector.importexample,
│ on zero_trust_tunnel_cloudflare_warp.tf line 11, in resource "cloudflare_zero_trust_tunnel_warp_connector" "importexample":
│ 11: resource "cloudflare_zero_trust_tunnel_warp_connector" "importexample" {
│
│ PATCH "https://api.cloudflare.com/client/v4/accounts/1234obfuscatedaccountid1234/warp_connector/1234obfuscatedtunneluuid1234": 400 Bad Request {"success":false,"errors":[{"code":1030,"message":"Could not parse
│ input. Json deserialize error: EOF while parsing a value at line 1 column 0"}],"messages":[],"result":null}
Expected output
I expected terraform apply
to complete successfully by importing 1 WARP Connector and creating a new WARP connector. Additionally, I expect the created resource to be recognized (warn instead of fail). The current failure does not indicate the resource was successfully created.
Actual output
New resource
Despite the provider bug error, the WARP connector is created but the command fails with exit code 1
. If the connector is created successfully, I would expect a warning instead, but preferably it succeeds without reporting a failure at all.
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to cloudflare_zero_trust_tunnel_warp_connector.terraform_test, provider "provider[\"registry.terraform.io/cloudflare/cloudflare\"]" produced an unexpected new value: .config_src: was
│ cty.StringVal("local"), but now null.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
Imported resource
The issue appears to be the same as the new resource: 'config_src'. The plan shows this updating to local
, and connections updating to empty array []. The state shows config_src: null
and a correctly populated connections array.. When I manually query the API endpoint, config_src
is not returned.
│ Error: failed to make http request
│
│ with cloudflare_zero_trust_tunnel_warp_connector.importexample,
│ on zero_trust_tunnel_cloudflare_warp.tf line 11, in resource "cloudflare_zero_trust_tunnel_warp_connector" "importexample":
│ 11: resource "cloudflare_zero_trust_tunnel_warp_connector" "importexample" {
│
│ PATCH "https://api.cloudflare.com/client/v4/accounts/1234obfuscatedaccountid1234/warp_connector/1234obfuscatedtunneluuid1234": 400 Bad Request {"success":false,"errors":[{"code":1030,"message":"Could not parse
│ input. Json deserialize error: EOF while parsing a value at line 1 column 0"}],"messages":[],"result":null}
$ ./curl.sh
{"success":true,"errors":[],"messages":[],"result":{"id":"1234obfuscatedtunneluuid1234","account_tag":"1234obfuscatedaccountid1234","created_at":"2025-08-19T13:38:14.572283Z","deleted_at":null,"name":"WARP IMPORT EXAMPLE","connections":[{"colo_name":"pdx03","uuid":"1234obfuscatedaccountid1234","id":"1234obfuscatedaccountid1234","is_pending_reconnect":false,"origin_ip":"obfuscated_ip","opened_at":"2025-08-30T09:11:53.022401Z","client_id":"1234obfuscatedaccountid1234","client_version":"n/a"}],"conns_active_at":"2025-08-30T09:11:53.022401Z","conns_inactive_at":null,"tun_type":"warp_connector","metadata":{},"status":"healthy"}}
Additional Notes
I attempted to manually edit state to force various values of config_src
but this did not work out, so I ended up manually removing the resources from state and commented out the import/resources. I ran into a similar issue with cloudflare_account
type
attribute recently where I was able to successfully edit state as a workaround, but in this case I was not able to perform the same workaround.
Steps to reproduce
Reproducing via new resource
- Create a new
cloudflare_zero_trust_tunnel_warp_connector
resource in *.tf terraform plan -out current.plan
terraform apply current.plan
Reproducing via imported resource
- Add import block for existing resource using
[account_id]/[tunnel_id]
- Add resource block matching existing resource, confirmed via API (not available in cf-terraforming)
terraform plan -out current.plan
terraform apply current.plan
Additional factoids
No response
References
https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/zero_trust_tunnel_warp_connector
https://developers.cloudflare.com/api/resources/zero_trust/subresources/tunnels/subresources/warp_connector/methods/create/
https://developers.cloudflare.com/api/resources/zero_trust/subresources/tunnels/subresources/warp_connector/methods/edit/
https://developers.cloudflare.com/api/resources/zero_trust/subresources/tunnels/subresources/warp_connector/methods/get/