Skip to main content

Set Up

Before You Begin

Make sure you have the following before starting:
  • Admin access in AWS and Redshift: You’ll need to create an IAM user and policy in AWS, and run grants as an administrator in your Redshift database.
  • A Redshift deployment: A Redshift Serverless workgroup or a provisioned cluster.
  • The data you want to sync identified: Know which database, and which schemas and tables, Conversion should be able to read from.

Step 1: Set Up Redshift Access

Conversion connects to Redshift through the AWS Redshift Data API using an IAM access key. In this step you’ll create a dedicated IAM user with a policy that allows Data API calls, then create an access key for it.
Your cluster can stay private. Conversion uses the AWS Redshift Data API, so you don’t need a public endpoint or an IP allowlist.

Create an IAM User and Policy

We recommend creating a dedicated IAM user for Conversion so its activity is easy to monitor and revoke.
  1. In the AWS console, open IAM → Users → Create user.
  2. Enter a user name such as conversion_sync and finish creating the user.
  3. Open the user and go to Permissions → Add permissions → Create inline policy.
  4. Select JSON and paste the policy below for your Redshift deployment.
  5. Replace the ARN placeholders with your AWS Region, account ID, and workgroup ID or cluster identifier and database name.
  6. Review and create the policy with a name such as ConversionRedshiftSync.
For Serverless, copy the workgroup ARN from its details in the Amazon Redshift console. The ARN uses the workgroup’s ID, not its name. For a provisioned cluster, copy the cluster ARN from its properties. In the separate dbname ARN, use the same cluster identifier and the database name you will enter in Conversion.
The statement status, result, and cancellation actions require Resource: "*" because they do not support resource-level permissions. Query execution is scoped to your workgroup or cluster. Serverless credentials are scoped to your workgroup; provisioned credentials are scoped to the database in your cluster. See the AWS Data API permissions reference and Redshift permissions reference.

Create an Access Key

  1. Open the IAM user’s Security credentials tab.
  2. Under Access keys, click Create access key.
  3. Choose Application running outside AWS and complete the access key creation flow.
  4. Save the Access key ID and Secret access key. AWS shows the secret only once. You’ll enter both in Conversion in Step 2.
To rotate your access key, create a new key for the same IAM user and update the credentials in your Conversion connection before deactivating the old key.

Step 2: Connect Redshift to Conversion

  1. In Conversion, go to Settings → CRM and syncing → Connections.
  2. Click Add Amazon Redshift connection.
  3. Fill in the connection details using the values from Step 1:
  4. Click Create connection.
Conversion verifies the connection. The check doesn’t read any tables, so it succeeds before you grant database access in Step 3.

Step 3: Grant Read Access to Your Data

Redshift maps your IAM user to a database user named IAM:<iam-user-name>. That user appears after the connection check in Step 2. In the Amazon Redshift query editor, connect to your target database as an administrator. Replace the schema, table, and IAM user name below, then run:
To read all existing tables in a schema, use this instead of the per-table grant:
For tables added later, run this as the database user that creates those tables:
Repeat the default-privilege grant for each table creator. See AWS default privileges. Repeat the grants for each schema and table you want to sync. The IAM policy permits Data API calls; these database grants permit reading your data.
The table picker lists only tables in schemas where your IAM database user has USAGE and tables where it has SELECT. If a table is missing, check both grants.

Create a Sync

After connecting, open your new Redshift connection and go to the Syncs tab to create a sync. Read more about Setting Up a Sync.

Redshift SQL Reference

Column Names

Select each destination field as its own column, named with the field key. Redshift lowercases column names. To keep mixed case, quote the alias and enable enable_case_sensitive_identifier on your cluster. Every result column needs a unique name. Duplicate or unnamed columns fail the sync even when preview works. Give expressions explicit aliases and rename duplicate columns from joins.

Converting Timestamps

Conversion expects Unix timestamps for date/time fields. Use EXTRACT(EPOCH FROM column)::bigint to convert Redshift TIMESTAMP values to Unix seconds:

Using last_sync_time

See Incremental Syncing for how last_sync_time works. In Redshift, add it to TIMESTAMP 'epoch' as seconds to compare against a TIMESTAMP column:
Or convert your column to Unix seconds and compare integers directly:
With a time buffer:

Handling NULLs

Use COALESCE or NVL to provide default values:

Casting Types

Use CAST or :: to convert between types:

Events

Select the contact’s email, event name, event time as Unix seconds in text, and a unique event ID. Quote the timestamp alias, since timestamp is a reserved word in Redshift:
Use an event_id that is unique across your event syncs so retries can deduplicate events. See Syncing Custom Events from a Warehouse.

Troubleshooting

”Missing permission” errors

AWS or Redshift rejected the IAM user. Check that:
  • The access key ID and secret access key belong to the same active IAM access key. AWS reports a mismatched or deleted key as an invalid security token.
  • For Serverless, the policy grants redshift-serverless:GetCredentials on the workgroup ARN. For a provisioned cluster, it grants redshift:GetClusterCredentialsWithIAM on the dbname ARN for your cluster and database.
  • The database user IAM:<iam-user-name> has USAGE on each schema and SELECT on each table from Step 3, in the database you entered in Conversion.

”Could not connect” errors

Verify that:
  • The Region is the one containing your workgroup or cluster
  • Deployment matches your setup: Serverless for a workgroup, Provisioned for a cluster
  • The workgroup name is its name, not its ARN or ID, and the cluster identifier is not an ARN
  • The database name exists in that workgroup or cluster

”Workgroup or cluster is starting” errors

A paused or resuming workgroup or cluster rejects queries until it’s available. Wait for it to become available, then try again.

Previews work but syncs fail

Sync queries need unique, named columns. See Column Names.

”The query result is too large. Add a filter or a LIMIT.” errors

Add a {{last_sync_time}} filter to limit the query to changed rows.

Sync taking too long

For general tips, see Sync Taking Too Long.

Frequently Asked Questions

The IAM user needs the Data API and credentials actions in the IAM policy. Its database user needs USAGE on the schemas and SELECT on the tables you want to sync. See Grant Read Access to Your Data. Conversion only reads your tables. Each sync also creates a temporary table that Redshift drops when the sync ends; Redshift lets every database user create temporary tables by default.
Conversion uses the Data API with IAM authentication. You provide an IAM access key and grant database access to its mapped user.
Yes. Each sync runs your query and retrieves the results in pages through the Data API. Serverless compute is billed per second with a 60-second minimum charge. See that AWS page for how the minimum applies.
Grant USAGE and SELECT on each schema and use schema-qualified table names in your query: