简体   繁体   中英

Google Cloud Functions 2nd Generation with Firebase Database trigger

I'm trying to update my function from cloud function 1st generation (java 11) to 2nd generation. Apparently some changes imply that the old implementation of the functions through Cloud CLI doesn't work on the new cloud functions. The old trigger was setting by this command:

--trigger-event providers/google.firebase.database/eventTypes/ref.create \
--trigger-resource projects/_/instances/root/message/{message_id}

Is still possible to run a function on "OnCreate" trigger from firebase database? It looks like it could be reach with the EventArc, but I don't find anywhere how to do that. Someone is already doing that or can clarify this?

As per the comment of @DazWilkin, there's an existing public issue tracker for this issue. As per the contents of the issue (as of March 18, 2022): "Cloud functions team identified the issue: the flag doesn't support the event because it only supports PubSub and GCS events, the team is going to change the message to be more specific."

On this note, there's a preview limitation stated in the official Firebase documentation (as of March 29, 2022):

Cloud Functions (2nd gen) offers Pub/Sub, Cloud Storage and Audit Log events through Eventarc. Additional events for Firestore, Firebase RTDB, Analytics, and Auth are planned.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM