How Can I Use Custom Configuration in My Cloud Function?
NOTE: This article is not applicable for AWS Lambda connectors created after October 4, 2022. We wrote this article before we changed the
secrets
object's functionality in our connector setup form.
Use Case
You are using a cloud function that Fivetran supports and need to pass additional configuration data to customize your function.
Recommendation
Fivetran's request format has a root node secrets
.
secrets
is an optional JSON object that you can use to provide additional fixed data. Fivetran passes this payload on every request to the function, allowing you to use that data to further configure your function.
Configure secrets
when you set up the Fivetran cloud function connector. In the connector setup form, enter the secrets using a JSON format.
Example request
Here's an example of an AWS Lambda request:
{
"agent" : "<function_connector_name>/<external_id>/<schema>",
"state": {
"cursor": "2018-01-01T00:00:00Z"
},
"secrets": {
"apiToken": "abcdefghijklmnopqrstuvwxyz_0123456789",
"configurationData": { ... input JSON data here ... }
...
"username": "testUsername",
"password": "testPassword"
...
}
}
Considerations
If you run into any unexpected behavior, contact your Solution Architect.