Closed thomastoye closed 2 years ago
Thank you for reporting this issue! For maintainers to dig into issues it is required that all issues include the entirety of TF_LOG=DEBUG
output to be provided. The only parts that should be redacted are your user credentials in the X-Auth-Key
, X-Auth-Email
and Authorization
HTTP headers. Details such as zone or account identifiers are not considered sensitive but can be redacted if you are very cautious. This log file provides additional context from Terraform, the provider and the Cloudflare API that helps in debugging issues. Without it, maintainers are very limited in what they can do and may hamper diagnosis efforts.
This issue has been marked with triage/needs-information
and is unlikely to receive maintainer attention until the log file is provided making this a complete bug report.
duplicates #1417
Oops, did not notice the duplicate (I only looked through the service/workers
tag. Thanks Jacob!
For anyone who stumbles upon this issue, set the module
attribute to upload ES Modules (this isn't very clear in the doc).
resource "cloudflare_worker_script" "api_script_entry" {
account_id = var.cloudflare_account_id
name = var.cloudflare_subdomain
content = file(var.cloudflare_script)
module = true
}
Confirmation
Terraform and Cloudflare provider version
Affected resource(s)
cloudflare_worker_script
Terraform configuration files
Debug output
Panic output
No response
Expected output
The
cloudflare_worker_script
resource supports script inputs in ESM format.Actual output
Steps to reproduce
Try to create a CFW from TF with the following example script:
Additional factoids
This works fine from Wrangler2
I have truncated the debug output to just the failing API call to upload the Worker as there was too much to redact.
We are on the Enterprise plan.
References
This thread describes the same issue: https://community.cloudflare.com/t/errors-deploying-worker-module-in-terraform/338909