Follow our setup guide to connect Google Cloud Functions to Fivetran.
Prerequisiteslink
To connect Google Cloud Functions to Fivetran, you need a Cloud Function implementation.
Setup instructionslink
Develop function codelink
-
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
.
For more information about Google Cloud Function implementation, see our Sample Google Cloud Function.
Create cloud functionlink
-
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 functionlink
-
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 namelink
-
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 Configurationlink
-
In your connector setup form, enter the Destination schema name of your choice.
-
Enter the Function Trigger you found in Step 4.
-
(Optional) Enter your Secrets. Use the following JSON format to enter your secrets:
{ "consumerKey": "", "consumerSecret": "", "apiKey": "yourApiKey" }
For more information on
secrets
, see our Function request and response documentation. -
Make a note of the service account email address. You will need it to grant invoker permissions to your function.
Grant function invoker permissionlink
-
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 Configurationlink
In your connector setup form, click Save & Test.
Fivetran tests and validates the Google Clould Functions connection. On successful completion of the setup tests, you can sync the data returned by the Google Cloud function to your destination.
Setup testslink
Fivetran performs the following Google Cloud Functions connection tests:
- The Validate Secrets test checks if you have entered the secrets in a valid JSON format.
- The Function Connection test checks if we can connect to your Google Cloud Function and if the function’s response format is correct.
IMPORTANT: The setup tests may timeout if your function’s response size is more than 500 megabytes (MB). In the setup tests request, Fivetran passes the
setup_test
node astrue
; and your function must return a lightweight JSON object that doesn’t exceed 500 MB in size. The 500 MB size limitation is only applicable to the setup tests and not for your syncs.
Related Contentlink
description Connector Overview
settings API Connector Configuration