How can I package the google-cloud-pubsub python library for use in AWS Lambda?

Viewed 28

I'm trying to create an AWS Lambda function that publishes data to a Google Cloud Pub/Sub topic. To do so, I'd like to use the google-cloud-pubsub Python library, however I'm running into some issues.

The documentation from google suggests I need to use call pubsub_v1 from google.cloud, however when I try to do so I get the error:

Unable to import module 'lambda_function': No module named 'google.cloud'

Indeed, when I look through my installed library (installed using a Cloud9 EC2 instance so I can install in Linux) I see that there is no module 'google.cloud'. Interestingly, I do see that module when I install the library to my macbook, although I can't package that as it won't play nice with AWS Lambda.

Can anyone suggest a method of installing the google-cloud-pubsub library in such a way that it includes the google.cloud module and can be packaged for use in AWS Lambda?

0 Answers
Related