Skip to content

Missing vpc_service binding type for cloudflare_worker_version #6961

@MainAero

Description

@MainAero

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:

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/cloudflare v5.18.0 (latest stable)
  • cloudflare/cloudflare v5.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions