Linking DynamoDB as a source
Let AI connect your sources for you
Skip the manual setup — run this in your project and the wizard auto-detects your databases and APIs and connects them to PostHog.

The DynamoDB connector syncs your database data into the PostHog data warehouse, so you can analyze it alongside your product data.
Prerequisites
You need an IAM role or IAM user with read access to DynamoDB. PostHog only reads data, so read access is enough.
The required permissions are:
dynamodb:ListTablesdynamodb:DescribeTabledynamodb:Scan
Adding a data source
- In PostHog, go to the Sources tab of the data pipeline section.
- Click + New source and click Link next to this source.
- Enter your credentials (see Configuration below) and click Next.
- Select the tables you want to sync, choose a sync method and frequency, then click Import.
Once the syncs are complete, you can start querying this data in PostHog.
Connect an IAM role or an access key with read access to DynamoDB to import your tables. Tables are read with a full table scan, so every sync uses read capacity on the table.
You can authenticate with either:
- IAM role (recommended) — provide the ARN of a role in your AWS account. PostHog assumes it with short-lived credentials.
- Access keys — provide an access key ID and secret access key for an IAM user.
You'll also be asked for:
- AWS region: the region your DynamoDB tables are in, for example
us-east-1.
Authentication
IAM role (recommended)
With IAM role assumption, PostHog uses AWS STS to assume a role in your AWS account and obtain short-lived credentials. This avoids storing long-lived access keys.
To set up IAM role authentication:
- In the source setup form, select the Assume IAM role tab.
- Create an IAM role in your AWS account with a trust policy that allows PostHog's role to assume it. The PostHog role ARN depends on your cloud region:
- US Cloud —
arn:aws:iam::309986977637:role/posthog-external-batch-exports - EU Cloud —
arn:aws:iam::623789312881:role/posthog-external-batch-exports
- US Cloud —
- Add an
sts:ExternalIdcondition to the trust policy. Set the value toposthog-<your_organization_id>(your organization ID is shown in the setup form). PostHog verifies this condition is enforced. - Attach a permissions policy to the role that grants the DynamoDB read permissions listed above.
- Paste the role ARN (e.g.,
arn:aws:iam::123456789012:role/posthog-dynamodb) into the IAM role ARN field.
Here's an example trust policy:
And an example permissions policy:
If any of your tables use a customer managed KMS key, also grant kms:Decrypt on that key.
Note: Self-hosted users should check with their instance administrator for the correct PostHog role ARN to trust.
Access keys
With access keys, you provide an AWS access key ID and secret access key that PostHog stores encrypted. This method works but uses long-lived credentials. Prefer IAM role assumption when possible.
To set up access key authentication:
- In the AWS Console, go to IAM > Users and create a new user (or use an existing one).
- Attach a policy with the following permissions:
- Create an access key for the user under Security credentials > Access keys.
- Copy the Access key ID and Secret access key — you'll need both when linking the source in PostHog.
Sync modes
Each table can be synced in one of several modes, depending on what the source supports:
- Webhook (when available) – the source pushes changes to PostHog in real time. Fastest freshness, lowest ongoing cost, and the only mode that reliably captures updates and deletes.
- Incremental – only new or updated rows are synced on each run, using a cursor field (such as an
updated_attimestamp). Cheaper than a full refresh, but deletes aren't captured. - Append only – new rows are appended using a cursor field; existing rows are never updated. Ideal for immutable, append-only tables like event logs.
- Full refresh – the whole table is reloaded on every sync. Use it when a table has no reliable cursor or when you need deletions reflected.
See sync methods for a full explanation of how each mode works and how to choose between them.
All DynamoDB tables are full refresh. Each sync replaces the contents of the table.
Configuration
| Option | Description |
|---|---|
AuthenticationType: select Required: True | With an IAM role, PostHog reads with short-lived credentials and stores no key. Create a role connection with your role's ARN, then grant the role the permissions listed above. |
AWS regionType: text Required: True |
Supported tables
The tables available from this source are discovered from your account when you connect it, so the exact list depends on your data. Once connected, you can pick which tables to sync from the sources tab.
Troubleshooting
- If the connection fails with an authorization error, check that your credentials are correct. For access keys, verify the key ID and secret. For IAM roles, verify the role ARN and that the trust policy includes the correct PostHog principal and external ID.
- If you see "These AWS credentials can't read DynamoDB", grant
dynamodb:ListTables,dynamodb:DescribeTable, anddynamodb:Scanto the IAM user or role. - If a table syncs no rows, the credential may not have access to that data. Check its permissions, then reconnect the source.
If your sync is failing or data looks wrong, see the Data warehouse troubleshooting guide. If that doesn't help, contact support – we're happy to help.





