feat: add support for reading message payload from bucket
Part of #36 (closed)
Description
This MR adds support reading the message payload from a bucket. It accepts INPUT_BUCKET
and INPUT_FILE
as environment variables, reads the content and passes that to the handlers, in a similar way how it would have been done in the normal ucam-faas
workflow.
Example run can be seen here (message
was {"foo":"bar"}
):
https://cloudlogging.app.goo.gl/9JMmYbv8XiUsdfxK8
How to test?
Since I deployed the example image to ucam-faas-long
development terraform, you can test it yourself:
- Go to the Google Cloud Console
- Go to the
faas-test
pub/sub topic - Send in a message
- Go to the
fl-test-pubsub
Cloud Run Job and confirm in the logs that it got the event