Linking AWS Config 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.

PostHog Wizard hedgehog

The AWS Config connector syncs resource configurations, compliance status, evaluation results, conformance packs, remediation executions, and aggregated resources into the PostHog data warehouse. You can query AWS Config data alongside your product data to understand how infrastructure changes affect your users.

Prerequisites

  • An AWS account with AWS Config enabled and a configuration recorder set up in the region you want to sync.
  • Credentials that can read the data you want to sync. PostHog only reads data, so read access is enough. You can connect with an IAM role or with access keys.

Adding a data source

  1. In PostHog, go to the Sources tab of the data pipeline section.
  2. Click + New source and click Link next to this source.
  3. Enter your credentials (see Configuration below) and click Next.
  4. 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.

When linking AWS Config, you need:

  • AWS region – the AWS region to sync data from (e.g. us-east-1). Defaults to us-east-1. Only the selected region is synced.
  • An authentication method – either an IAM role or access keys.

AWS authentication

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. Credentials refresh hourly, and the role session is scoped to only the IAM actions AWS Config needs.

To set up IAM role authentication:

  1. In the AWS Config setup form, select the IAM role tab.
  2. Create an IAM role in your AWS account with a trust policy that allows PostHog's warehouse sources role to assume it. The PostHog role ARN depends on your cloud region:
    • US Cloud – arn:aws:iam::309986977637:role/posthog-external-warehouse-sources
    • EU Cloud – arn:aws:iam::623789312881:role/posthog-external-warehouse-sources
  3. Add an sts:ExternalId condition to the trust policy. Set the value to posthog-<your_organization_id> (your organization ID is shown in the setup modal). PostHog verifies this condition is enforced – syncs fail without it.
  4. Attach a permissions policy to the role that grants the AWS Config read actions for the tables you want to sync.
  5. Paste the role ARN (e.g. arn:aws:iam::123456789012:role/posthog-warehouse-config) into the IAM role ARN field in the setup form.

Here's an example trust policy for US Cloud:

JSON
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::309986977637:role/posthog-external-warehouse-sources"
},
"Action": "sts:AssumeRole",
"Condition": {
"StringEquals": {
"sts:ExternalId": "posthog-<your_organization_id>"
}
}
}
]
}

For EU Cloud, replace the principal ARN with arn:aws:iam::623789312881:role/posthog-external-warehouse-sources.

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:

  1. In the AWS Config setup form, select the Access keys tab.
  2. Enter your AWS access key ID (starts with AKIA...) and AWS secret access key.
  3. If you're using temporary STS credentials, also enter the AWS session token. Temporary credentials expire, so update them before scheduled syncs run.

Required IAM permissions

The IAM permissions you need depend on which tables you select. To enable all tables, attach this policy to your IAM role or user:

JSON
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"config:DescribeComplianceByConfigRule",
"config:DescribeConfigRules",
"config:DescribeConfigurationAggregators",
"config:DescribeConformancePacks",
"config:DescribeRemediationExecutionStatus",
"config:GetComplianceDetailsByConfigRule",
"config:GetConformancePackComplianceDetails",
"config:GetResourceConfigHistory",
"config:ListConformancePackComplianceScores",
"config:ListResourceEvaluations",
"config:SelectAggregateResourceConfig",
"config:SelectResourceConfig"
],
"Resource": "*"
}
]
}

If you only need specific tables, grant just the permissions for those tables:

TableRequired permissions
resourcesconfig:SelectResourceConfig
config_rulesconfig:DescribeConfigRules
rule_complianceconfig:DescribeComplianceByConfigRule
conformance_packsconfig:DescribeConformancePacks
conformance_pack_compliance_scoresconfig:ListConformancePackComplianceScores
rule_evaluation_resultsconfig:DescribeConfigRules, config:GetComplianceDetailsByConfigRule
aggregated_resourcesconfig:DescribeConfigurationAggregators, config:SelectAggregateResourceConfig
resource_config_historyconfig:SelectResourceConfig, config:GetResourceConfigHistory
conformance_pack_evaluation_resultsconfig:DescribeConformancePacks, config:GetConformancePackComplianceDetails
remediation_execution_statusesconfig:DescribeConfigRules, config:DescribeRemediationExecutionStatus
resource_evaluationsconfig:ListResourceEvaluations

Creating an IAM user (access keys)

  1. In the AWS Console, go to IAM > Users and create a new user (or use an existing one).
  2. Attach a policy with the permissions for the tables you want.
  3. Create an access key for the user under Security credentials > Access keys.
  4. Copy the Access key ID and Secret access key – you 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_at timestamp). 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.

TableSync modeNotes
resourcesFull refreshCurrent configurations of recorded resources in the selected region. Excludes deleted resources.
config_rulesFull refreshAWS Config rules, their evaluation settings, and resource scopes.
rule_complianceFull refreshCurrent compliance status and counts of noncompliant resources for each rule.
conformance_packsFull refreshConformance packs and their deployment settings in the selected region.
conformance_pack_compliance_scoresFull refreshPercentage of compliant rule and resource combinations in each conformance pack.
rule_evaluation_resultsFull refreshLatest evaluation result for each resource that each AWS Config rule evaluated.
aggregated_resourcesFull refreshCurrent configurations of resources across the accounts and regions of each configuration aggregator.
resource_config_historyIncrementalConfiguration items recorded for each current resource. Without a saved incremental value, reads the last 90 days.
conformance_pack_evaluation_resultsFull refreshLatest evaluation result for each rule and resource in each conformance pack.
remediation_execution_statusesFull refreshState and step details of the latest remediation execution for each resource and rule.
resource_evaluationsIncrementalProactive evaluations of resource configurations, usually run before deployment.

Duplicate rows are merged by primary key, so re-read periods don't create duplicates.

Configuration

OptionDescription
Authentication
Type: 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 region
Type: text
Required: False

Defaults to us-east-1. Only the selected region is synced.

Supported tables

TableDescriptionSync methodIncremental fieldPrimary key
resources

Current configurations of recorded resources in the selected region. Excludes deleted resources.

Full refresh——
config_rules

AWS Config rules, their evaluation settings, and resource scopes.

Full refresh——
rule_compliance

Current compliance status and counts of noncompliant resources for each rule.

Full refresh——
conformance_packs

Conformance packs and their deployment settings in the selected region.

Full refresh——
conformance_pack_compliance_scores

Percentage of compliant rule and resource combinations in each conformance pack.

Full refresh——
rule_evaluation_results

Latest evaluation result for each resource that each AWS Config rule evaluated.

Full refresh——
aggregated_resources

Current configurations of resources across the accounts and regions of each configuration aggregator in the selected region.

Full refresh——
resource_config_history

Configuration items recorded for each current resource in the selected region. Without a saved incremental value, the table reads the last 90 days.

Incremental, Full refreshconfiguration_item_capture_time—
conformance_pack_evaluation_results

Latest evaluation result for each rule and resource in each conformance pack.

Full refresh——
remediation_execution_statuses

State and step details of the latest remediation execution for each resource and rule.

Full refresh——
aggregate_rule_compliance

Compliance status of each rule in each account and region of each configuration aggregator in the selected region.

Full refresh——
resource_compliance

Overall compliance status of each evaluated resource, with the count of rules it does not comply with.

Full refresh——
rule_evaluation_statuses

Last successful and failed invocation and evaluation times, and the last error, of each rule.

Full refresh——
remediation_configurations

Remediation action set up for each rule, with its SSM document, parameters, and automatic retry settings.

Full refresh——
resource_evaluations

Proactive evaluations of resource configurations, usually run before deployment.

Incremental, Full refreshevaluation_start_timestamp—

Troubleshooting

  • Authorization or access denied error – the IAM role or user doesn't have the required permissions for the selected tables. Check the permissions table and update the policy.
  • Signature or credential error – re-enter the secret access key. If you're using temporary credentials, the session token may have expired.
  • "Enable AWS Config" or "Set up a recorder" error – AWS Config isn't enabled in the selected region, or no configuration recorder is set up. Enable AWS Config and create a recorder in the AWS Console.
  • No rows synced for a table – the credential may not have access to that data, or the feature may not be configured. For example, the aggregated_resources table requires at least one configuration aggregator, and conformance_packs requires conformance packs to be deployed.
  • IAM role assumption fails – verify the trust policy includes the correct PostHog role ARN for your cloud region and that the external ID matches posthog-<your_organization_id>. PostHog checks that the external ID condition is enforced.

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.

Still have questions?

Was this page useful?