pulumi / pulumi-cloudflare

Pulumi's Cloudflare package, providing multi-language infrastructure as code for Cloudflare
Apache License 2.0
104 stars 13 forks source link

Support for ES module worker scripts #969

Open bozyk-m opened 3 days ago

bozyk-m commented 3 days ago

According to this: https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/ ES module syntax is a preferred way of developing workers. Yet, with Pulumi, it's not supported to have a multi-file worker script. Exemplary script from Cloudflare Dashboard, named "To-do List App" consists of multiple files Image

when imported the copy-paste fragment does not reflect that:

accountId:  "omitted"
content: (json) {
  license: "ISC"
  name: "calm-dawn-d154"
  version: "1.0.0"
}

kvNamespaceBindings: [
  [0]: {
    name: "EXAMPLE_TODOS"
    namespaceId: "omitted"
  }
]
name : "calm-dawn-d154"

This seems to be supported in the Terraform provider - https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/workers_script#any_part_name-1

Is there any chance to add support for this in the Pulumi provider?

iwahbe commented 15 hours ago

Hi @bozyk-m, thanks for opening an issue. It is supported on the Terraform provider in 5.0.0-alpha1. pulumi-cloudflare tracks cloudflare/terraform-provider-cloudflare's stable, so we don't have the alpha release. As soon as terraform-provider-cloudflare releases 5.0.0, we will add support.