terraform-provider-cloudflare icon indicating copy to clipboard operation
terraform-provider-cloudflare copied to clipboard

terraform cloudflare_turnstile_widget Error reading challenge widget when offlabel=true

Open MagonBC opened this issue 7 months ago • 4 comments

Confirmation

  • [X] My issue isn't already found on the issue tracker.
  • [X] I have replicated my issue using the latest version of the provider and it is still present.

Terraform and Cloudflare provider version

Terraform v1.7.1

Provider cloudflare/cloudflare v4.16.0 and v4.23.0

Affected resource(s)

cloudflare_turnstile_widget

Terraform configuration files

resource "cloudflare_turnstile_widget" "main" {
  account_id = "05frrr5f66s5ss5568fe"
  name       = "Example Widget"
  domains    = "[mydomain.com]"
  mode       = "non-interactive"
  offlabel   = "true"
}

Link to debug output

https://gist.github.com/MagonBC/6b05a7006e792f9a59e0db31bde5da6f

Panic output

No response

Expected output

Terraform will perform the following actions:

cloudflare_turnstile_widget.main will be updated in-place

~ resource "cloudflare_turnstile_widget" "main" { ~ bot_fight_mode = false -> (known after apply) id = "0xthesite_key" name = "Example Widget" ~ offlabel = false -> true ~ region = "world" -> (known after apply) ~ secret = (sensitive value) # (3 unchanged attributes hidden) }

Plan: 0 to add, 1 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_turnstile_widget.main: Modifying... [id=thesite_key] cloudflare_turnstile_widget.main: Modifications complete after 1s [id=thesite_key]

Actual output

╷ │ Error: Error reading challenge widget │ │ with cloudflare_turnstile_widget.main, │ on main.tf line 1, in resource "cloudflare_turnstile_widget" "main": │ 1: resource "cloudflare_turnstile_widget" "main" { │ │ required site key missing ╵

Steps to reproduce

With Turnstile Widget license free: (https://www.cloudflare.com/products/turnstile/)

  1. set offlabel=true
  2. terraform apply
  3. reset offlabel=false
  4. terraform apply

With Enterprise License:

  1. terraform apply
  2. set offlabel=true
  3. terraform apply

Additional factoids

No response

References

No response

MagonBC avatar Jan 31 '24 10:01 MagonBC

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

github-actions[bot] avatar Jan 31 '24 10:01 github-actions[bot]

Terraform debug log detected :white_check_mark:

github-actions[bot] avatar Jan 31 '24 10:01 github-actions[bot]

Can you set true instead of "true" in the terraform config?

ingack99 avatar Feb 21 '24 08:02 ingack99

Can you set true instead of "true" in the terraform config?

It's not related to the "true". I've the same issue, but use booleans without quotes.

snstamml avatar Apr 08 '24 15:04 snstamml

Hello, have you find any workaround? I am getting the same error no matter what arguments I combine. I am using enterprise version.

EDIT: deleting state and start over is way to go.

JohnyGemityg avatar May 03 '24 12:05 JohnyGemityg

This functionality has been released in v4.32.0 of the Terraform Cloudflare Provider.

Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

github-actions[bot] avatar May 08 '24 01:05 github-actions[bot]