Skip to content

Optional fields cause crash in cloudflare_zero_trust_tunnel_cloudflared(s) when left null #5524

@aurimasniekis

Description

@aurimasniekis

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.11.4
on darwin_arm64

  • provider registry.terraform.io/cloudflare/cloudflare v5.3.0

Affected resource(s)

data.cloudflare_zero_trust_tunnel_cloudflared
data.cloudflare_zero_trust_tunnel_cloudflareds

(Probably more than these as it's seams it's related to RFC3339 parsing)

Terraform configuration files

data "cloudflare_zero_trust_tunnel_cloudflareds" "this" {
  account_id = ""
}

Link to debug output

Not needed

Panic output

╷
│ Error: RFC3339 ValueRFC3339Time Error
│ 
│   with data.cloudflare_zero_trust_tunnel_cloudflareds.this,
│   on main.tf line 11, in data "cloudflare_zero_trust_tunnel_cloudflareds" "this":
│   11: data "cloudflare_zero_trust_tunnel_cloudflareds" "this" {
│ 
│ RFC3339 string value is null
╵

Expected output

Optional fields should be… well, optional. The resource should return all tunnels when no filters are applied, instead of crashing due to null values.

Actual output

Fails with an RFC3339 parsing error when optional fields are unset. This also means it’s currently impossible to fetch all tunnels without applying time filters. Even when both applied it doesn't work because both filters filter out results...

Steps to reproduce

1.	Use the data source without setting was_active_at or was_inactive_at
2.	Run terraform plan or apply
3.	Observe the crash

Additional factoids

No response

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.version/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