-
Notifications
You must be signed in to change notification settings - Fork 985
Extend services bindings to support VPC Services. #10628
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
base: main
Are you sure you want to change the base?
Conversation
e.g. `"services": [{ "binding": "MYAPI", "service_id": "0199295b-b3ac-7760-8246-bca40877b3e9" }]`
🦋 Changeset detectedLatest commit: 524d2ba The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Failed to automatically backport this PR's changes to Wrangler v3. Please manually create a PR targeting the Depending on your changes, running Notes:
|
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
@@ -891,29 +891,46 @@ export interface EnvironmentNonInheritable { | |||
* @nonInheritable | |||
*/ | |||
services: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pretty unusual way to add a new binding. Usually there'd be a new top level key vpcs
which had these VPC services under it. Is there a particular reason this needs to be under services
? I think it's probably going to cause a fair amount of user confusion, and will make the implementation more complex
service_id: binding.service_id, | ||
}; | ||
} else { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// eslint-disable-next-line @typescript-eslint/no-explicit-any |
if ("service_id" in serviceBinding && serviceBinding.service_id) { | ||
metadataBindings.push({ | ||
name: serviceBinding.binding, | ||
type: "connectivity_service_binding", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a different binding type to service
, and so should really be a different config property
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, it's a little odd to include a _binding
suffix in the binding type—I don't think most others do it like that
Implements WVPC-42.
Extend services bindings to support VPC Services.
e.g.
"services": [{ "binding": "MYAPI", "service_id": "0199295b-b3ac-7760-8246-bca40877b3e9" }]
I am pretty confident with the
deploy
andtypes
, but less so withwrangler dev
and its various modes - I will need to dig in more but wanted to get this initially reviewed. Also becauseservices
is now a union (either aservice
or aservice_id
) there is some added complexity here that probably needs improving.Docs PR to follow