A ready-made AWS Lambda function you can invoke to publish messages into Google's PubSub system.
It's really useful for bridging AWS compute with Firebase or other Google Cloud projects.
Follow the guide to setup Workload Identity Federation in your Google Cloud projects.
Then you can deploy the code in this repository as a Node.js Lambda function in your AWS account.
Check out the Releases section for packages and instructions.
Hosted versions are available out of my personal AWS account, should you need to get running quickly. You're encouraged to host it on your own accounts and service is provided without any guarantees or warranty express or implied.
CloudFormation:
https://github.saobby.my.eu.org-hf-pubpubsub-<region>.s3.amazonaws.com/release/cloudformation/<release>
Lambda:
https://github.saobby.my.eu.org-hf-pubpubsub-<region>.s3.amazonaws.com/release/lambda/<release>
Currently available in: us-east-1, eu-west-1. Open an issue to
request availability in other regions.
Note that you're only allowed to access the S3 object, not the bucket itself. You must do it using AWS credentials, and your identity will be visible in my CloudTrail account.
The Lambda function expects these environment variables:
GOOGLE_CLOUD_PROJECT_NUMBERGCP project number where the Workload Identity Federation provider residesGOOGLE_CLOUD_WEB_IDENTITY_POOLID of the web identity poolGOOGLE_CLOUD_WEB_IDENTITY_POOL_AWS_PROVIDERID of the AWS provider in the web identity poolGOOGLE_CLOUD_SERVICE_ACCOUNT_EMAILService account email to impersonateGOOGLE_CLOUD_DEFAULT_PROJECT_ID(Optional) Project ID where messages without aprojectIdproperty will be directed to
The Lambda function can be invoked synchronously or asynchronously.
It accepts a JSON object with the following structure:
topicPub/Sub topic to which to publishmessageA string representing the message to be publishedbase64(Optional) A boolean whether themesasgeis encoded in Base64projectId(Optional) GCP project ID where thetopiclives
It outputs a JSON object with the following structure:
topicPub/Sub topic where the message was publishedprojectIdGCP project ID where thetopiclivesmessageIdID of the message in thetopic
Copyright © 2022 Stojan Dimitrovski. Some rights reserved.
Licensed under the MIT X11 License. You can find a copy of it under LICENSE.