Back to plugin list
Official
Premium
Alibaba Cloud
The Alibaba Cloud source plugin for CloudQuery extracts configuration from the Alibaba Cloud API and loads it into any supported CloudQuery destination
Publisher
cloudquery
Latest version
v5.8.0
Type
Source
Platforms
Date Published
Price per 1M rows
Starting from $15
monthly free quota
1M rows
Set up process #
brew install cloudquery/tap/cloudquery
1. Download CLI and login
2. Create source and destination configs
Plugin configurationOverview #
Alibaba Cloud Source Plugin
The Alibaba Cloud source plugin for CloudQuery extracts configuration from the Alibaba Cloud (阿里云) API and loads it into any supported CloudQuery destination (e.g. PostgreSQL, BigQuery, Snowflake, and more).
Configuration #
The following configuration syncs from Alibaba Cloud to a Postgres destination. The (top level) source spec section is described in the Source Spec Reference. The config for the
postgresql
destination is not shown here. See our Quickstart if you need help setting up the destination.kind: source
spec:
name: "alicloud"
path: "cloudquery/alicloud"
registry: "cloudquery"
version: "v5.8.0"
tables: ["*"]
destinations: ["postgresql"]
# Learn more about the configuration options at https://cql.ink/alicloud_source
spec:
accounts:
- name: my_account
regions:
- cn-hangzhou
- cn-beijing
- eu-west-1
- us-west-1
# ...
access_key: ${ALICLOUD_ACCESS_KEY}
secret_key: ${ALICLOUD_SECRET_KEY}
# Optional parameters
# concurrency: 50000
# bill_history_months: 12
Alibaba Spec #
concurrency
(integer
, optional, default:50000
):A best effort maximum number of Go routines to use. Lower this number to reduce memory usage.scheduler
(string
, optional, default:dfs
):The scheduler to use when determining the priority of resources to sync. Supported values aredfs
(depth-first search),round-robin
,shuffle
andshuffle-queue
.For more information about this, see performance tuning.accounts
(array[object]
, required):A list of accounts to sync. Every account must have a unique name, and must specify at least one region. Theaccess_key
andsecret_key
are required and can be specified as environment variables, as shown in the example above.name
(string
, required): A unique name for the account.regions
(array[string]
, required): A list of regions to sync. For example,["cn-hangzhou", "cn-beijing"]
.access_key
(string
, required): A valid access key for the accountsecret_key
(string
, required): A valid secret key for the account, corresponding to the access key
bill_history_months
(integer
, optional):The number of months of billing history to fetch for thealicloud_bss_bill
andalicloud_bss_bill_overview
tables. Defaults to 12.
See the Alibaba documentation for how to obtain an AccessKey pair.
Authentication #
Authentication is done via access keys. See Obtain an AccessKey pair for more information.
It is highly recommended that you use environment variable expansion to store your access key pair. For example, you can set the following environment variables:
ALICLOUD_ACCESS_KEY
- The access key ID.ALICLOUD_SECRET_KEY
- The access key secret.
And then use them in the configuration as follows:
access_key: ${ALICLOUD_ACCESS_KEY}
secret_key: ${ALICLOUD_SECRET_KEY}
Example Queries #
Find all ECS instances in a region #
select
instance_id,
os_name,
region_id,
start_time,
tags
from
alicloud_ecs_instances
where
region_id = 'eu-west-1';
+------------------------+--------------------------------------+-----------+-------------------+---------------+
| instance_id | os_name | region_id | start_time | tags |
|------------------------+--------------------------------------+-----------+-------------------+---------------|
| i-xxxxxxxxxxxxxxxxxxxx | Alibaba Cloud Linux 3.2104 LTS 64位 | eu-west-1 | 2023-01-17T14:40Z | {"Tag": null} |
+------------------------+--------------------------------------+-----------+-------------------+---------------+
Query past bills #
select
product_name,
item,
pip_code,
currency,
adjust_amount
from
alicloud_bss_bill_overview;
+------------------------+----------------+----------+----------+---------------+
| product_name | item | pip_code | currency | adjust_amount |
|------------------------+----------------+----------+----------+---------------|
| Object Storage Service | PayAsYouGoBill | oss | USD | 0.0 |
+------------------------+----------------+----------+----------+---------------+
Query bucket stats #
select
account_id,
bucket_name,
object_count,
storage
from
alicloud_oss_bucket_stats;
+------------+-------------+--------------+---------+
| account_id | bucket_name | object_count | storage |
|------------+-------------+--------------+---------|
| test | cq-test | 2 | 29665 |
+------------+-------------+--------------+---------+