terraform-provider-cloudflare: Provider produced invalid plan

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

terraform: 1.3.9 cloudflare: 4.0.0

Affected resource(s)

efs_volumes

Terraform configuration files

main.tf

provider "cloudflare" {
  email   = var.cloudflare_email
  api_key = var.cloudflare_api_key
}

Link to debug output

https://gist.github.com/mrarar/0626767498350b8049f4e06a8327c599

Panic output

No response

Expected output

Successful terraform plan.

Actual output

│ Error: Provider produced invalid plan │ │ Provider “registry.terraform.io/cloudflare/cloudflare” planned an invalid │ value for cloudflare_record.efs_volumes_stg.allow_overwrite: planned value │ cty.False for a non-computed attribute. │ │ This is a bug in the provider, which should be reported in the provider’s │ own issue tracker. ╵ ╷ │ Error: Provider produced invalid plan │ │ Provider “registry.terraform.io/cloudflare/cloudflare” planned an invalid │ value for cloudflare_record.efs_volumes_stg.tags: planned value │ cty.SetValEmpty(cty.String) for a non-computed attribute. │ │ This is a bug in the provider, which should be reported in the provider’s │ own issue tracker. ╵ ╷ │ Error: Provider produced invalid plan │ │ Provider “registry.terraform.io/cloudflare/cloudflare” planned an invalid │ value for cloudflare_record.efs_volumes_stg.comment: planned value │ cty.StringVal(“”) for a non-computed attribute. │ │ This is a bug in the provider, which should be reported in the provider’s │ own issue tracker. ╵ ╷ │ Error: Provider produced invalid plan │ │ Provider “registry.terraform.io/cloudflare/cloudflare” planned an invalid │ value for cloudflare_record.efs_volumes_stg.proxied: planned value │ cty.False for a non-computed attribute. │ │ This is a bug in the provider, which should be reported in the provider’s │ own issue tracker.

Steps to reproduce

terraform init. terraform plan.

Additional factoids

No response

References

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 22
  • Comments: 20 (1 by maintainers)

Most upvoted comments

I was doing a POC and I had to use version 3.31.0 of the provider for it to run properly without comments and tags arguments. The issue starts on 3.32.0 https://github.com/cloudflare/terraform-provider-cloudflare/commit/3401db071cea511b73e9347095dff3455b512be4

Also setting tags will not work if you are using a free account: https://developers.cloudflare.com/dns/manage-dns-records/reference/record-attributes/#record-tags

Same issue with different resources: Cloudflare Provider Version: v4.5.0

╷
│ Error: Provider produced invalid plan
│ 
│ Provider "registry.terraform.io/cloudflare/cloudflare" planned an invalid
│ value for module.web["test-news.bitcoin.com"].cloudflare_zone.zone.paused:
│ planned value cty.False for a non-computed attribute.
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.
╵
╷
│ Error: Provider produced invalid plan
│ 
│ Provider "registry.terraform.io/cloudflare/cloudflare" planned an invalid
│ value for module.web["test-news.bitcoin.com"].cloudflare_zone.zone.type:
│ planned value cty.StringVal("full") for a non-computed attribute.
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.
╵

It appears what is happening is that the cloudflare_record resource is forcing the optional configs and would not pass my terraform plan until I added in values to allow_overwrite, comment, proxied, and tags.

thanks @simpson-ross 🙇 that helps clarify things here.

TF version 1.1.4 and prior exhibit this error

this is expected since terraform < 1.1.5 had an issue (hashicorp/terraform#30330) which incorrectly marked fields as nullable=false. it was already addressed in 1.2.x but this fix was backported to 1.1.5 if you must run the 1.x release series.

$ ASDF_TERRAFORM_VERSION=1.1.4 terraform apply
╷
│ Error: Provider produced invalid plan
│ 
│ Provider "registry.terraform.io/cloudflare/cloudflare" planned an invalid value for cloudflare_record.mx_1.allow_overwrite: planned value cty.False for a non-computed attribute.
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵
$ ASDF_TERRAFORM_VERSION=1.1.5 terraform apply

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # cloudflare_record.mx_1 will be created
  + resource "cloudflare_record" "mx_1" {
      + allow_overwrite = false
      + created_on      = (known after apply)
      + hostname        = (known after apply)
      + id              = (known after apply)
      + metadata        = (known after apply)
      + modified_on     = (known after apply)
      + name            = "@"
      + priority        = 5
      + proxiable       = (known after apply)
      + ttl             = 300
      + type            = "MX"
      + value           = "route1.mx.cloudflare.net"
      + zone_id         = "0da42c8d2132a9ddaf714f9e7c920711"
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

cloudflare_record.mx_1: Creating...
cloudflare_record.mx_1: Creation complete after 0s [id=318a0b16eea91338ef42a36ef8d51adc]

do you see this behaviour with terraform > 1.2 and the 4.x release of the provider?

I am having this problem in other resources (mainly from cloudflare zerotrust) and in my case I have some resources that I need to create that are only available in the 4+ versions of the provider, so I am waiting for the resolution of this case. For now I use the provider in version 3.31, but without creating some resources having to resort to clickops (for example zerotrust lists)

Error: Provider produced invalid plan

Provider "registry.terraform.io/cloudflare/cloudflare" planned an invalid
value for
module.cloudflare_logpush.cloudflare_logpush_job.gateway_network.kind:
planned value cty.StringVal("") for a non-computed attribute.

This is a bug in the provider, which should be reported in the provider's own
issue tracker.

Error: Provider produced invalid plan

Provider "registry.terraform.io/cloudflare/cloudflare" planned an invalid
value for
module.cloudflare_logpush.cloudflare_logpush_job.gateway_network.filter:
planned value cty.StringVal("") for a non-computed attribute.

This is a bug in the provider, which should be reported in the provider's own
issue tracker.

Error: Provider produced invalid plan

Provider "registry.terraform.io/cloudflare/cloudflare" planned an invalid
value for
module.cloudflare_logpush.cloudflare_logpush_job.gateway_network.frequency:
planned value cty.StringVal("high") for a non-computed attribute.

This is a bug in the provider, which should be reported in the provider's own
issue tracker.

Same here, we have to pin back to 3.32 in our case

This worked for me as well @edumgui

same even for us

│ Error: Provider produced invalid plan │  │ Provider “registry.terraform.io/cloudflare/cloudflare” planned an invalid │ value for cloudflare_record.main[2].tags: planned value │ cty.SetValEmpty(cty.String) for a non-computed attribute. │  │ This is a bug in the provider, which should be reported in the provider’s │ own issue tracker. ╵ ╷ │ Error: Provider produced invalid plan │  │ Provider “registry.terraform.io/cloudflare/cloudflare” planned an invalid │ value for cloudflare_record.main[2].allow_overwrite: planned value │ cty.False for a non-computed attribute. │  │ This is a bug in the provider, which should be reported in the provider’s │ own issue tracker. ╵ ╷ │ Error: Provider produced invalid plan │  │ Provider “registry.terraform.io/cloudflare/cloudflare” planned an invalid │ value for cloudflare_record.main[2].proxied: planned value cty.False for a │ non-computed attribute. │  │ This is a bug in the provider, which should be reported in the provider’s │ own issue tracker. ╵ ╷ │ Error: Provider produced invalid plan │  │ Provider “registry.terraform.io/cloudflare/cloudflare” planned an invalid │ value for cloudflare_record.main[2].comment: planned value │ cty.StringVal(“”) for a non-computed attribute. │  │ This is a bug in the provider, which should be reported in the provider’s │ own issue tracker. ╵ ╷ │ Error: Provider produced invalid plan │  │ Provider “registry.terraform.io/cloudflare/cloudflare” planned an invalid │ value for cloudflare_record.main[3].allow_overwrite: planned value │ cty.False for a non-computed attribute. │  │ This is a bug in the provider, which should be reported in the provider’s │ own issue tracker. ╵ ╷ │ Error: Provider produced invalid plan │  │ Provider “registry.terraform.io/cloudflare/cloudflare” planned an invalid │ value for cloudflare_record.main[3].tags: planned value │ cty.SetValEmpty(cty.String) for a non-computed attribute. │  │ This is a bug in the provider, which should be reported in the provider’s │ own issue tracker. ╵ ╷ │ Error: Provider produced invalid plan │  │ Provider “registry.terraform.io/cloudflare/cloudflare” planned an invalid │ value for cloudflare_record.main[3].proxied: planned value cty.False for a │ non-computed attribute. │  │ This is a bug in the provider, which should be reported in the provider’s │ own issue tracker. ╵ ╷ │ Error: Provider produced invalid plan │  │ Provider “registry.terraform.io/cloudflare/cloudflare” planned an invalid │ value for cloudflare_record.main[3].comment: planned value │ cty.StringVal(“”) for a non-computed attribute. │  │ This is a bug in the provider, which should be reported in the provider’s │ own issue tracker. ╵ ╷ │ Error: Provider produced invalid plan │  │ Provider “registry.terraform.io/cloudflare/cloudflare” planned an invalid │ value for cloudflare_record.main[0].allow_overwrite: planned value │ cty.False for a non-computed attribute. │  │ This is a bug in the provider, which should be reported in the provider’s │ own issue tracker. ╵ ╷ │ Error: Provider produced invalid plan │  │ Provider “registry.terraform.io/cloudflare/cloudflare” planned an invalid │ value for cloudflare_record.main[0].tags: planned value │ cty.SetValEmpty(cty.String) for a non-computed attribute. │  │ This is a bug in the provider, which should be reported in the provider’s │ own issue tracker. ╵ ╷ │ Error: Provider produced invalid plan │  │ Provider “registry.terraform.io/cloudflare/cloudflare” planned an invalid │ value for cloudflare_record.main[0].proxied: planned value cty.False for a │ non-computed attribute. │  │ This is a bug in the provider, which should be reported in the provider’s │ own issue tracker. ╵ ╷ │ Error: Provider produced invalid plan │  │ Provider “registry.terraform.io/cloudflare/cloudflare” planned an invalid │ value for cloudflare_record.main[0].comment: planned value │ cty.StringVal(“”) for a non-computed attribute. │  │ This is a bug in the provider, which should be reported in the provider’s │ own issue tracker. ╵ ╷ │ Error: Provider produced invalid plan │  │ Provider “registry.terraform.io/cloudflare/cloudflare” planned an invalid │ value for cloudflare_record.main[1].tags: planned value │ cty.SetValEmpty(cty.String) for a non-computed attribute. │  │ This is a bug in the provider, which should be reported in the provider’s │ own issue tracker. ╵ ╷ │ Error: Provider produced invalid plan │  │ Provider “registry.terraform.io/cloudflare/cloudflare” planned an invalid │ value for cloudflare_record.main[1].allow_overwrite: planned value │ cty.False for a non-computed attribute. │  │ This is a bug in the provider, which should be reported in the provider’s │ own issue tracker. ╵ ╷ │ Error: Provider produced invalid plan │  │ Provider “registry.terraform.io/cloudflare/cloudflare” planned an invalid │ value for cloudflare_record.main[1].proxied: planned value cty.False for a │ non-computed attribute. │  │ This is a bug in the provider, which should be reported in the provider’s │ own issue tracker. ╵ ╷ │ Error: Provider produced invalid plan │  │ Provider “registry.terraform.io/cloudflare/cloudflare” planned an invalid │ value for cloudflare_record.main[1].comment: planned value │ cty.StringVal(“”) for a non-computed attribute. │  │ This is a bug in the provider, which should be reported in the provider’s │ own issue tracker. ╵