CloudQuery Plugin Configuration
A CloudQuery sync fetches data from cloud accounts (sources) and writes it to one or more destinations. A sync requires at least one source- and one destination configuration. Configuration files are specified in YAML format and can be either split across multiple files or combined.
Example using multiple files
One option is to maintain configuration for your source and destination plugins in separate files.
Here is a simple example with only one source and one destination plugin:
kind: source
spec:
name: aws
path: cloudquery/aws
registry: cloudquery
version: "v22.19.2"
tables: ["aws_s3_buckets"]
destinations: ["postgresql"]
kind: destination
spec:
name: postgresql
path: cloudquery/postgresql
registry: cloudquery
version: "v7.3.4"
spec:
connection_string: ${PG_CONNECTION_STRING}
With these two files, we can run a sync using:
cloudquery sync aws.yml postgresql.yml
Adding another source
Let's imagine we now wanted to add a gcp
source as well. We can add its configuration in a new file:
kind: source
spec:
name: gcp
path: cloudquery/gcp
registry: cloudquery
version: "v10.0.0"
tables: ["gcp_storage_buckets"]
destinations: ["postgresql"]
And now sync both aws
and gcp
to postgresql
in a single command:
cloudquery sync aws.yml gcp.yml postgresql.yml
Example using one file
You can also combine sources and destinations into a single file by separating the sections with ---
:
kind: source
spec:
name: aws
path: cloudquery/aws
registry: cloudquery
version: "v22.19.2"
tables: ["aws_s3_buckets"]
destinations: ["postgresql"]
---
kind: destination
spec:
name: postgresql
path: cloudquery/postgresql
registry: cloudquery
version: "v7.3.4"
spec:
connection_string: ${PG_CONNECTION_STRING}
Now we can run a sync using:
cloudquery sync config.yml
This example shows only two plugin sections, but a config file is allowed to contain any number of plugin sections.