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-Typewith the valueapplication/json.
For more information about Google Cloud Function implementation, see .
Create cloud function
Open the console and click the projects drop-down list.

Select the project in which you want to create the function.
Click Create Function.

In the Environment drop-down menu, select the cloud function's generation: 1st gen or 2nd gen.
Enter the Function name.
In Region drop-down menu, select the region.
Based on your Environment, do the following in the Trigger section:
1st gen

- In the Trigger type drop-down menu, select HTTP.
- In the Authentication section, select Require authentication.
- Click Save.
2nd gen
In the Authentication section, select Require authentication. Click Save.

In the RUNTIME tab, do the following:
- In the Memory allocated drop-down menu, select the memory allocation size for the function.
- Enter the Timeout.
- Enter the Maximum number of instances.

In the CONNECTIONS tab, in the Ingress settings section, select Allow all traffic.

Click Next.
In the Runtime drop-down menu, select your runtime environment.
Select the Source code type.
NOTE: We have used the Inline editor option to illustrate.
Specify the Entry point. This is the entry point for your function code execution.

Click Deploy.
Test cloud function
Open the cloud function you created in .

In the TESTING tab, add one example request and then click Test the function.

NOTE: You can view the execution result in the Output field.
Get trigger name
Go to the TRIGGER tab.

Make a note of the Trigger URL. You will need it to configure Google Cloud Functions to connect with Fivetran.
Begin Fivetran configuration
In your , enter the Destination schema name of your choice.
Enter the Function Trigger you found in .
(Optional) Click + Add secrets to specify your secrets as key-value pairs. - Enter your Secret Name. The secret name must be unique. - Enter your Secret Key associated with the secret name.
For example, if you want to pass the
secretsas{'apiKey': 'yourApiKey', 'consumerKey': 'test'}, add a key-value pair for each entry in the JSON structure. Make sure that the key names are unique in the key-value pairs.TIP: For Google Cloud Functions connectors created before August 9, 2023, enter your Secrets using the following JSON format:
{ "consumerKey": "", "consumerSecret": "", "apiKey": "yourApiKey" }content_copyNOTE: For more information on
secrets, see .Make a note of the service account email address. You will need it to grant invoker permissions to your function.
Grant function permission
If in , you selected 1st gen as the Environment, do the following:
In the PERMISSIONS tab, click GRANT ACCESS.

In New principals field, add the service account email ID you found in .
In the Role drop-down menu, select Cloud Functions Invoker.

Click Save.
If in , you selected 2nd gen as the Environment, do the following:
In your , open Cloud Run.
Click SHOW INFO PANEL > ADD PRINCIPAL.

In New principals field, add the service account email ID you found in .
In the Role drop-down menu, select Cloud Run Invoker.

Click Save.
Finish Fivetran configuration
In your , click Save & Test.
Fivetran 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 tests
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_testfield astrue; and your function must return a lightweight JSON object with thehasMorefield asfalse, not exceeding 500 MB in size. The 500 MB size limitation is only applicable to the setup tests and not for your syncs.
Related articles
Comments
0 comments
Please sign in to leave a comment.