-
Notifications
You must be signed in to change notification settings - Fork 808
Open
Description
Description
The cloudflare_worker_version resource does not support vpc_service as a valid binding type, despite it being documented in the official Cloudflare documentation:
- https://developers.cloudflare.com/workers-vpc/configuration/vpc-services/terraform/
- https://developers.cloudflare.com/workers/platform/infrastructure-as-code/
Expected behavior
The following configuration should be valid:
resource "cloudflare_worker_version" "example" {
account_id = var.account_id
worker_id = cloudflare_worker.example.id
compatibility_date = "2025-03-25"
main_module = "worker.js"
modules = [{
name = "worker.js"
content_type = "application/javascript+module"
content_file = "worker.js"
}]
bindings = [{
type = "vpc_service"
name = "PRIVATE_API"
service_id = cloudflare_connectivity_directory_service.example.service_id
}]
}Actual behavior
Terraform validation fails with:
Error: Invalid Attribute Value Match
Attribute bindings[0].type value must be one of: ["ai" "analytics_engine" "assets" "browser" "d1"
"data_blob" "dispatch_namespace" "durable_object_namespace" "hyperdrive" "inherit" "images" "json"
"kv_namespace" "mtls_certificate" "plain_text" "pipelines" "queue" "ratelimit" "r2_bucket"
"secret_text" "send_email" "service" "text_blob" "vectorize" "version_metadata"
"secrets_store_secret" "secret_key" "workflow" "wasm_module"], got: "vpc_service"
Versions tested
cloudflare/cloudflarev5.18.0 (latest stable)cloudflare/cloudflarev5.19.0-beta.2 (latest beta)
Both reject vpc_service as a binding type.
Context
The cloudflare_connectivity_directory_service resource exists and works, but Workers cannot bind to the created VPC Service because the binding type is missing from the allowed values enum.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels