Skip to Content
PlatformIntegration GuidesAWS (Manual Setup)

Setting up an AWS Integration

CloudQuery Platform authenticates with AWS through cross-account IAM roles using IAM Roles for Service Accounts (IRSA). This guide walks through the manual setup process. Use this if your organization manages IAM roles through infrastructure-as-code (Terraform, CDK) or restricts CloudFormation usage. For an automated approach using CloudFormation, see the AWS Onboarding Wizard.

The AWS accounts involved are:

  • CloudQuery Account: The AWS account where CloudQuery Platform is deployed. This account hosts the IAM role that CloudQuery uses to assume roles in other accounts.
  • Your Account: The AWS account you want to sync resources from. You create a role here that allows the CloudQuery account’s role to assume it and read resources.

Prerequisites

  • A CloudQuery Platform account with admin access
  • AWS CLI installed and configured with credentials that have IAM administrative permissions
  • Your AWS account ID
  • EXTERNAL_ID: Generate this yourself (e.g., by running uuidgen). An external ID is recommended by AWS best practices to provide an additional verification layer when assuming roles in a third-party account. It can be any alphanumeric string between 2 and 1224 characters.

Step 1: Select configuration mode

  1. Navigate to Data PipelinesIntegrations.
  2. Click Create Integration and select AWS.
  3. Choose how to configure what CloudQuery syncs from your AWS account.

AWS Setup Wizard — configuration mode selector

  • All features: enables all three features automatically — Asset Inventory, Cost Metrics, and Additional Metadata. Recommended for most users.
  • Individual features: lets you choose which features to enable from the list below.
  • Manual services and tables configuration: lets you select individual AWS services or specific tables to sync. Does not set up Cost Metrics.

If you selected Individual features, choose from the following:

FeatureWhat it syncsSync created
Asset Inventory301 core AWS resource tables (EC2, IAM, RDS, S3, Lambda, etc.) plus CloudTrail write eventsTwo syncs: {integration name} - Asset Inventory and {integration name} - CloudTrail
Cost MetricsAWS Cost and Usage Report (CUR 2.0) data via BCM Data ExportsOne sync: {integration name} - Cost and Usage using the cloudquery/awscur plugin
Additional Metadata68 supplementary tables for snapshots, policies, attachments, and account credentials — used by Reports and InsightsOne sync: {integration name} - Additional Metadata

If you selected Manual services and tables configuration, choose the AWS services or individual tables you want to sync. Cost Metrics are not available in this mode.

All features is recommended for most users. It enables the Asset Inventory view, cost analysis, and all Reports and Insights functionality out of the box.

Step 2: Choose authentication method and account scope

Select Manual authentication method. This will allow you to provide your own IAM role ARNs.

AWS Setup Wizard — manual setup

IAM role and permissions

Deploy the read-only role and Cost & Usage export with one CloudFormation stack instead of running the commands in the other tab. The stack creates a role that trusts the role used by CloudQuery.

Replace the <EXTERNAL_ID> in the command below with a value you generate (e.g. uuidgen).

Replace the <CLOUDQUERY_ROLE_ARN> with the role ARN displayed in the side panel documentation on the integration UI page in CloudQuery Platform.

aws s3 cp s3://cq-cloud-cloudformation-templates-us-east-1/onboarding/unified/self-service-template.json self-service-template.json && \ aws cloudformation deploy \ --stack-name cloudquery-readonly \ --template-file self-service-template.json \ --capabilities CAPABILITY_NAMED_IAM \ --region us-east-1 \ --parameter-overrides \ CloudQueryRoleArn=<CLOUDQUERY_ROLE_ARN> \ ExternalId=<EXTERNAL_ID> \ EnableAssetInventory=true \ EnableCostAndUsage=true

When the stack reaches CREATE_COMPLETE, read its outputs:

aws cloudformation describe-stacks \ --stack-name cloudquery-readonly \ --region us-east-1 \ --query "Stacks[0].Outputs" --output table

Copy RoleArn and CurReportName from the outputs into the Role ARN and CUR report name fields, and enter the same External ID you used in the command. Cost & Usage is single-account, so deploy the stack in that one account only.

  1. Click Test and Continue to verify the setup.

  2. Specify the schedule and destination

You can specify how often the integration data gets refreshed from the cloud provider. We recommend scheduling syncs to run daily to keep your asset inventory and insights up to date.

If you choose to sync to an external destination (other than CloudQuery), the synced data will not be visible in CloudQuery directly.

Review your selected configuration and click Create to finalize. CloudQuery will start syncing the data.

What gets synced

The AWS integration can sync over 500 tables across all major AWS services. Some of the most commonly used tables include:

CategoryTablesDescription
Computeaws_ec2_instances, aws_lambda_functionsEC2 instances, Lambda functions
Storageaws_s3_buckets, aws_ebs_volumesS3 buckets, EBS volumes
Networkingaws_ec2_vpcs, aws_ec2_security_groups, aws_ec2_subnetsVPCs, security groups, subnets
Identityaws_iam_roles, aws_iam_users, aws_iam_policiesIAM roles, users, policies
Databasesaws_rds_instances, aws_rds_clustersRDS instances and clusters

See the full AWS table list for all available tables.

Verify the integration

After your first syncs complete, browse your AWS resources in the Asset Inventory under the Compute, Storage, Identity, and other categories.

You can also open the SQL Console and run these queries to confirm data arrived:

-- Count synced EC2 instances SELECT count(*) FROM aws_ec2_instances
-- List synced AWS accounts and regions SELECT DISTINCT account_id, region FROM aws_ec2_instances
-- View S3 buckets across accounts SELECT account_id, name, region FROM aws_s3_buckets LIMIT 10

Troubleshooting

IssueCauseFix
AccessDenied when assuming roleTrust relationship misconfiguredVerify the Principal ARN in the trust policy matches the CloudQuery account role exactly. Check that <CLOUDQUERY_AWS_ACCOUNT_ID> and <TENANT_ID> are correct.
External ID mismatchEXTERNAL_ID in trust policy differs from the secretEnsure the EXTERNAL_ID value in the IAM trust policy matches the secret value in CloudQuery Platform exactly
InvalidIdentityTokenIRSA configuration issueVerify the CloudQuery Platform deployment has a valid OIDC provider. See AWS IRSA documentation.
No data after syncTables list is empty or incorrectIn the YAML configuration, check the tables field. Use ["*"] to sync everything, or specify individual table names from the AWS tables list.
Partial data (missing accounts)Member roles not deployedFor multi-account setups, verify the CloudFormation StackSet deployed roles to all target accounts. Run aws cloudformation describe-stacks to check.

Next steps

Was this page helpful?

Last updated on