cloudflare / terraform-provider-cloudflare

Cloudflare Terraform Provider
https://registry.terraform.io/providers/cloudflare/cloudflare
Mozilla Public License 2.0
786 stars 609 forks source link

Incorrectly reported deprecated resource when cloudflare_workers_cron_trigger resource is used #4118

Closed stankolubomir closed 3 weeks ago

stankolubomir commented 1 month ago

Confirmation

Terraform and Cloudflare provider version

Terraform v1.9.5 Cloudflare provider 4.42.0

Affected resource(s)

cloudflare_workers_cron_trigger

Terraform configuration files

resource "cloudflare_workers_cron_trigger" "default" {
  account_id  = "your-account-id"
  script_name = "example-name"
  schedules   = [
    "0 * * * *",
    "1 * * * *",
    "2 * * * *",
  ]
}

Link to debug output

https://gist.github.com/stankolubomir/937ae55a418347069581b14267328049

Panic output

No response

Expected output

No changes. Your infrastructure matches the configuration.

Actual output

Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed. ╷ │ Warning: Deprecated Resource │ │ with module.worker_script.cloudflare_workers_cron_trigger.default, │ on ../../../modules/cf/cloudflare-worker/main.tf line 59, in resource "cloudflare_workers_cron_trigger" "default": │ 59: resource "cloudflare_workers_cron_trigger" "default" { │ │ cloudflare_worker_cron_trigger is now deprecated and will be removed in the next major version. Use cloudflare_workers_cron_trigger instead. │ │ (and one more similar warning elsewhere) ╵

Steps to reproduce

Just run terraform plan or apply.

Additional factoids

Here is the faulty line in code: https://github.com/cloudflare/terraform-provider-cloudflare/blob/96d6cbf6ddb631095789c22afd49f88833957eeb/internal/sdkv2provider/resource_cloudflare_workers_cron_trigger.go#L35C6-L35C42

There is: func resourceCloudflareWorkersCronTrigger() schema.Resource { should be: func resourceCloudflareWorkerCronTrigger() schema.Resource {

References

Issue was introduced by https://github.com/cloudflare/terraform-provider-cloudflare/pull/3500

github-actions[bot] commented 1 month ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

github-actions[bot] commented 1 week ago

This functionality has been released in v4.45.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!