This message was deleted.
# general
s
This message was deleted.
b
hey Oliver, sorry you're not getting much help here - unfortunately I'm not super familiar with these functions/workflow, but perhaps you might get some assistance on stackOverflow?
i hate to direct your somewhere else, so I'll see if I can figure something out later today
b
I think I might have just figured it out. The
eventType
should be
google.pubsub.topic.publish
instead of
providers/cloud.pubsub/eventTypes/topic.publish
. The docs here: https://www.pulumi.com/docs/reference/pkg/gcp/cloudfunctions/function/#functioneventtrigger send you to the docs here: https://cloud.google.com/functions/docs/calling/pubsub. In those docs they show the current way, which doesn't match the Resource in Pulumi, and the legacy way which does match the Resource but uses the wrong trigger.
A nicer error message would be dandy though I think you're just showing what Google sent you so that seems hard 😞
b
would you be able to post the full example if it's working, or DM it to me? I'd love to create an example to refer to for others
b
I'd be happy to but the code I have to do this isn't super simple because I've set up a "self deploy" system where the code for a cloud function can have a
deploy.yml
file in it's directory and we auto-discover that, build the function from it, determine the trigger type from it, etc. so there's some yml parsing,
if
statements, etc.
The important bit of code is this however:
Copy code
trigger_args = gcp.cloudfunctions.FunctionEventTriggerArgs(
            event_type='google.pubsub.topic.publish',
            resource=topic.id)
        function_args['event_trigger'] = trigger_args