Skip to content

Updating imported cloudflare_zero_trust_tunnel_cloudflared_virtual_network resource results in "500 Internal Server Error" #5098

@joebon

Description

@joebon

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

Terraform v1.10.5
on darwin_arm64
+ provider registry.terraform.io/cloudflare/cloudflare v5.0.0

Affected resource(s)

  • cloudflare_zero_trust_tunnel_cloudflared_virtual_network

Terraform configuration files

resource "cloudflare_zero_trust_tunnel_cloudflared_virtual_network" "tunnel_vnet" {
  account_id = var.cloudflare_account_id
  name       = "${var.env_name}-vnet"
  comment    = "Virtual network for ${var.env_name}"
}

Link to debug output

https://gist.github.com/joebon/09bf20712a21f372c5cb90459b43aac2

Panic output

No response

Expected output

The pending changes/diff to be applied

Actual output

module.des.cloudflare_zero_trust_tunnel_cloudflared_virtual_network.tunnel_vnet: Modifying... [id=[redacted]]
╷
│ Error: failed to make http request
│ 
│   with module.des.cloudflare_zero_trust_tunnel_cloudflared_virtual_network.tunnel_vnet,
│   on path/to/tunnel.tf line 303, in resource "cloudflare_zero_trust_tunnel_cloudflared_virtual_network" "tunnel_vnet":
│  303: resource "cloudflare_zero_trust_tunnel_cloudflared_virtual_network" "tunnel_vnet" {
│ 
│ PATCH "https://api.cloudflare.com/client/v4/accounts/[redacted]/teamnet/virtual_networks/[redacted]": 500 Internal Server Error {"success":false,"errors":[{"code":1000,"message":"Internal server error"}],"messages":[],"result":null}
╵

Steps to reproduce

  1. Create a virtual network, either using CF web Dashboard or using the 4.x provider version
  2. Migrate to provider version 5.0.0
  3. Remove existing state for the virtual network (since resource name change)
  4. Import the existing virtual network
  5. Attempt to apply

Additional factoids

No response

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.no-issue-activityversion/5Categorizes issue or PR as related to version 5 of the provider.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions