Cloudflare launched multi script support for non enterprise accounts some week ago.
It's not possible to create a multiscript for non enterprise accounts using terraform plugin.
2:29 $ terraform -v
Terraform v0.12.2
Please list the resources as a list, for example:
module.maps.cloudflare_worker_script.script: Creating...
Error: error creating worker script: organization ID required for enterprise only request
on terraform-modules/worker/script.tf line 6, in resource "cloudflare_worker_script" "script":
6: resource "cloudflare_worker_script" "script" {
resource (module):
resource "cloudflare_worker_script" "script" {
name = "${var.name}"
content = file("dist/${var.name}.js")
}
resource "cloudflare_worker_route" "script-route" {
zone = "${var.zone}"
pattern = "${var.pattern}"
enabled = var.enabled
depends_on = [cloudflare_worker_script.script]
}
scripts and routes should have been created
nothing is created.
possibly issue in cloudflare-go? https://github.com/cloudflare/cloudflare-go/blob/cf0705549ebf3ec9123c27b1f9e64af7b93eb08b/workers.go#L94
Thanks for reporting this @perosb! Have you tried setting org_id equal to your account ID in the Terraform configuration? It's not ideal but it might work for now.
It will be great to generalise this functionality to not be Enterprise specific now as that was a bit of a headache to iron out.
Thanks @jacobbednarz!
Setting org_id worked perfectly.
Where does org_id go?
provider "cloudflare" { org_id = "<the id>" }
In the provider config.
@perosb #478 is generalising this functionality so you no longer need the org_id work around and will be released with 2.0 (along with some other breaking changes).
Most helpful comment
Thanks for reporting this @perosb! Have you tried setting
org_idequal to your account ID in the Terraform configuration? It's not ideal but it might work for now.It will be great to generalise this functionality to not be Enterprise specific now as that was a bit of a headache to iron out.