Model sync from BigQuery to Salesforce
To create a model sync from BigQuery to Salesforce using Terraform, follow these steps:
Prerequisites: • Ensure you have the Polytomic Terraform provider installed. • Obtain your Polytomic API key and set it as an environment variable:
1. Configure the Polytomic provider
🚧 Prerelease
The Polytomic Terraform provider is currently available as pre-release software. Until we reach version 1.0, the beta version must be set explicitly.
Begin by configuring the Polytomic provider in your Terraform script:
Ensure that var.polytomic_api_key
is defined in your variables or passed appropriately.
🤝 Partner keys
If you are using a Partner Key, specify the key along with an organization user email. A user with that email will be used when operating on an organization. The user will be created if it does not exist.
2. Create a BigQuery connection
Define a resource for the BigQuery connection:
Note that the service account key is loaded using the file
function here; any
string value or variable is acceptable.
3. Create a Salesforce connection
Polytomic supports multiple authorization mechanisms for Salesforce connections. In order to manage a Salesforce connection via Terraform, the client ID and secret must be provided. If you want to use Polytomic’s OAuth flow for Salesforce connections, those must be created in the admin console or using the Polytomic authentication API. After that they may be referenced using the Terraform datasource.
Define a resource for the Salesforce connection:
🤝 Parter keys
When using a partner key, the Organization ID must also be specified as a property for each resource.
4. Create a Polytomic data model for user data
Define a resource for the data model that queries BigQuery:
5. Create a sync from Snowflake to Salesforce
Define a resource to sync the data model to Salesforce. In this example we’re creating an update-only sync to Salesforce Contacts which uses the email address to match records.
6. Apply the Terraform Configuration
Initialize Terraform and apply the configuration:
Review the changes and confirm to proceed.
For more details, refer to the Polytomic Terraform provider documentation.