Publisher
cloudquery
Repository
github.comLatest version
v2.3.6
Type
Policy
Published
Category
Cloud Infrastructure
Loading addon documentation
Publisher
cloudquery
Repository
github.comLatest version
v2.3.6
Type
Policy
Published
Category
Cloud Infrastructure
Loading addon documentation
We use tracking cookies to understand how you use the product and help us improve it. Please accept cookies to help us improve. You can always opt out later via the link in the footer.
select account_id, count(*)
from aws_resources
group by account_id
order by count(*) desc
select account_id, service, count(*)
from aws_resources
group by account_id, service
order by count(*) desc;
select * from aws_resources
where tags is null or tags = '{}';
_cq_id
_cq_source_name
_cq_sync_time
account_id
request_account_id
type
arn
region
tags
partition
service
_cq_table
pip install dbt-postgres
mkdir -p ~/.dbt
profiles.yml
file in your profile directory (e.g. ~/.dbt/profiles.yml
):aws_asset_inventory: # This should match the name in your dbt_project.yml
target: dev
outputs:
dev:
type: postgres
host: 127.0.0.1
user: postgres
pass: pass
port: 5432
dbname: postgres
schema: public # default schema where dbt will build the models
threads: 1 # number of threads to use when running in parallel
profiles.yml
, you should test the connection to ensure everything is configured correctly. First, switch to the directory where you extracted this package. Then run this command:dbt debug
...
09:37:00 retries: 1
09:37:00 Registered adapter: postgres=1.9.0
09:37:00 Connection test: [OK connection ok]
09:37:00 All checks passed!
cloudquery login
aws.yaml
.
For detailed AWS authentication and configuration options and additional tables to add to the sync config, see the AWS plugin documentation.kind: source
spec:
name: aws # The source type, in this case, AWS.
path: cloudquery/aws # The plugin path for handling AWS sources.
registry: cloudquery # The registry from which the AWS plugin is sourced.
version: "v32.38.0" # The version of the AWS plugin.
tables: ["aws_ec2_instances"] # Include any tables that meet your requirements, separated by commas
destinations: ["postgresql"] # The destination for the data, in this case, PostgreSQL.
spec:
---
kind: destination
spec:
name: "postgresql" # The type of destination, in this case, PostgreSQL.
path: "cloudquery/postgresql" # The plugin path for handling PostgreSQL as a destination.
registry: "cloudquery" # The registry from which the PostgreSQL plugin is sourced.
version: "v8.9.0" # The version of the PostgreSQL plugin.
spec:
connection_string: "${POSTGRESQL_CONNECTION_STRING}" # set the environment variable in a format like
# postgresql://postgres:pass@localhost:5432/postgres?sslmode=disable
# You can also specify the connection string in DSN format, which allows for special characters in the password:
# connection_string: "user=postgres password=pass+0-[word host=localhost port=5432 dbname=postgres"
cloudquery sync aws.yaml
dbt run
command, it might be useful to check for any potential issues:dbt compile
dbt run
dbt
models and create tables/views in your destination database as defined in your models.dbt-core
and not dbt-cloud-cli
as dbt-core does not require extra authentication.select * from aws_resources limit 10
dbt run
command) only if you add or remove tables from the sync.