Skip to content

Commit 7481764

Browse files
authored
Adds 'eventarcpublishing' as required API to custom event function (#1300)
Adds `eventarcpublishing.googleapis.com` as a required API for the `onCustomEventPublished` trigger so that the CLI enables it on deployment. Attempting to deploy a cloud function to GCF that listens on a non-existent channel will throw an error; `eventarcpublishing` API is necessary to allow the CLI to create the channel before the function is deployed.
1 parent 21f4dcb commit 7481764

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
- Allow Functions to specify vpcConnector as a string parameter (#1329)
22
- Upgrade jsonwebtoken to version 9 (#1336)
3+
- Adds 'eventarcpublishing' as required API to custom event function

src/v2/providers/eventarc.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,5 +225,12 @@ export function onCustomEventPublished<T = any>(
225225

226226
func.__endpoint = endpoint;
227227

228+
func.__requiredAPIs = [
229+
{
230+
api: "eventarcpublishing.googleapis.com",
231+
reason: "Needed for custom event functions",
232+
},
233+
];
234+
228235
return func;
229236
}

0 commit comments

Comments
 (0)