-
Notifications
You must be signed in to change notification settings - Fork 630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No way to enable the default <worker_name>.<account_name>.workers.dev
route in cloudflare_worker_script
#3268
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
Thank you for reporting this issue! For maintainers to dig into issues it is required that all issues include the entirety of This issue has been marked with |
How is it an enhancement to prevent users from correctly configuring their resources? You allow to do it in Wrangler but not in Terraform, so there's clearly something wrong. |
It's concerning that SST had to resort to examining Wrangler's source code to discover and utilize a shadow API for enabling the default route. Relying on such workarounds shouldn't be necessary, and Cloudflare should provide proper documentation and official support for this basic functionality. |
it's an enhancement because the resource works, it is however missing a particular function of the service. there is work in progress to make this automatic (see https://blog.cloudflare.com/lessons-from-building-an-automated-sdk-pipeline) but for the mean time, it is a feature request to the service team to implement. you can see the reasoning behind it not existing in the SDKs (and subsequently Terraform) at https://github.com/cloudflare/cloudflare-go/blob/master/docs/public-api-documentation.md#but-wranglercloudflaredother-project-doesnt-require-public-documentation. i totally agree there is an issue here lacking coverage and no documentation for it but to address it, we need the service team to add the new feature which is not tracked in GitHub (until the automation is in place). |
Description
Currently, the
cloudflare_worker_script
resource in the Terraform Cloudflare provider lacks the ability to enable the default route (<worker_name>.<subdomain>.workers.dev
) upon deployment. This issue requests the addition of a property or mechanism to control the default route's activation state.Terraform and Cloudflare Provider Versions
Affected Resource
cloudflare_worker_script
Steps to Reproduce
cloudflare_worker_script
resource.<worker_name>
➜ Settings ➜ Triggers in the Cloudflare dashboard.cloudflare_worker_script
resource to enable the default route.Expected Behavior
A new property or mechanism should be introduced to the
cloudflare_worker_script
resource, allowing users to specify whether the default route should be enabled or disabled upon deployment.Actual Behavior
Currently, the default route remains disabled after deploying the worker script, and there's no option to control its state within the Terraform configuration.
Additional Context
While no official API exists for enabling the default route, the Wrangler CLI utilizes an undocumented API endpoint to achieve this.
This suggests that the Terraform provider could potentially implement similar functionality to enable the default route during worker script deployment.
Potential Implementation
One possible approach is to add a boolean attribute like
enable_default_route
to the resource. Setting it totrue
would activate the default route upon deployment.Benefits
The text was updated successfully, but these errors were encountered: