Google Cloud Functions Setup Guide
Follow our setup guide to connect Google Cloud Functions to Fivetran.
Prerequisites
To connect Google Cloud Functions to Fivetran, you need a Cloud Function implementation.
Setup instructions
Develop function code
-
Using an IDE or any other tool, develop the code that you want to run in the Google Cloud Functions.
-
In the response header, add
Content-Type
with the valueapplication/json
.
See our sample function.
Create cloud function
-
Open the Google Cloud Functions console and click the projects drop-down list.
-
Select the project in which you want to create the function.
-
Click Create Function.
-
In the Name field, enter the function name.
-
Select the memory allocation size for the function in the Memory allocated drop-down menu.
-
Select HTTP in the Trigger drop-down menu.
-
Uncheck the Allow unauthenticated invocations checkbox (if selected).
-
Select the Source code type.
We have used the Inline editor option to illustrate.
-
Select your runtime environment in the Runtime drop-down menu.
-
Enter the code to execute in the cloud function (Copy the code and
package.json
content in the inline editor provided by Google Cloud Functions). -
Enter the function name to execute when the cloud function is invoked. This is the entry point for your function code execution.
-
Configure the following Advanced options:
- Select the region in the Region drop-down menu
- Enter the Timeout time frame
- Enter the maximum number of function instances
- In Networking > Ingress settings, select Allow all traffic
-
Click Create to create the function.
Test cloud function
-
Open the cloud function you created in Step 2.
-
Click Testing. Add one example request and click Test the function.
You can view the execution result in the Output field.
Get trigger name
-
Open the cloud function.
-
Click Trigger.
-
Make a note of the URL. You will need it to configure Google Cloud Functions to connect with Fivetran.
Begin Fivetran Configuration
-
In your connector setup form, enter the Destination schema name of your choice.
-
Enter the Function Trigger you found in Step 4.
-
Enter your Secrets. Use the following format to enter your secrets:
{ "consumerKey": "", "consumerSecret": "", "twittertopic": "NHL" }
-
Make a note of the service account email address. You will need it to grant invoker permissions to your function.
Grant function invoker permission
-
In Google Cloud Functions, select the cloud function and click Show Info Panel.
-
In the Info Panel, click Add Member.
-
Add the service account email ID displayed in the connector setup form.
-
Select Cloud Functions Invoker in the Role drop-down menu.
-
Click Save to save the permissions.
Finish Fivetran Configuration
In your connector setup form, click Save & Test. Fivetran will take it from here and sync your data from Google Cloud Functions.
Related articles
description Connector Overview
settings API Connector Configuration