Issue
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?
Solution
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.
Answered By - RJC
Answer Checked By - Mildred Charles (JavaFixing Admin)