turbot/alicloud

GitHub
steampipe plugin install alicloudsteampipe plugin install alicloud
alicloud_accountalicloud_action_trailalicloud_cas_certificatealicloud_cms_monitor_hostalicloud_cs_kubernetes_clusteralicloud_cs_kubernetes_cluster_nodealicloud_ecs_auto_provisioning_groupalicloud_ecs_autoscaling_groupalicloud_ecs_diskalicloud_ecs_disk_metric_read_iopsalicloud_ecs_disk_metric_read_iops_dailyalicloud_ecs_disk_metric_read_iops_hourlyalicloud_ecs_disk_metric_write_iopsalicloud_ecs_disk_metric_write_iops_dailyalicloud_ecs_disk_metric_write_iops_hourlyalicloud_ecs_imagealicloud_ecs_instancealicloud_ecs_instance_metric_cpu_utilization_dailyalicloud_ecs_instance_metric_cpu_utilization_hourlyalicloud_ecs_key_pairalicloud_ecs_launch_templatealicloud_ecs_network_interfacealicloud_ecs_regionalicloud_ecs_security_groupalicloud_ecs_snapshotalicloud_ecs_zonealicloud_kms_keyalicloud_kms_secretalicloud_oss_bucketalicloud_ram_access_keyalicloud_ram_credential_reportalicloud_ram_groupalicloud_ram_password_policyalicloud_ram_policyalicloud_ram_rolealicloud_ram_security_preferencealicloud_ram_useralicloud_rds_backupalicloud_rds_databasealicloud_rds_instancealicloud_rds_instance_metric_connectionsalicloud_rds_instance_metric_connections_dailyalicloud_rds_instance_metric_cpu_utilizationalicloud_rds_instance_metric_cpu_utilization_dailyalicloud_rds_instance_metric_cpu_utilization_hourlyalicloud_security_center_field_statisticsalicloud_security_center_versionalicloud_slb_load_balanceralicloud_vpcalicloud_vpc_dhcp_options_setalicloud_vpc_eipalicloud_vpc_flow_logalicloud_vpc_nat_gatewayalicloud_vpc_network_aclalicloud_vpc_route_entryalicloud_vpc_route_tablealicloud_vpc_ssl_vpn_client_certalicloud_vpc_ssl_vpn_serveralicloud_vpc_vpn_connectionalicloud_vpc_vpn_customer_gatewayalicloud_vpc_vpn_gatewayalicloud_vpc_vswitch

Table: alicloud_rds_instance

Provides an RDS instance resource. A DB instance is an isolated database environment in the cloud. A DB instance can contain multiple user-created databases.

Examples

Basic info

select
db_instance_id,
arn,
vpc_id,
creation_time,
engine
from
alicloud_rds_instance;

DB instance count in each region

select
region_id as region,
db_instance_class,
count(*)
from
alicloud_rds_instance
group by
region_id,
db_instance_class;

List DB instances whose engine is MySQL

select
db_instance_id,
vpc_id,
creation_time,
engine
from
alicloud_rds_instance
where
engine = 'MySQL';

List DB instances that are currently running

select
db_instance_id,
vpc_id,
creation_time,
engine
from
alicloud_rds_instance
where
db_instance_status = 'Running';

List DB instances that allow 0.0.0.0/0

select
db_instance_id,
security_ips
from
alicloud_rds_instance
where
security_ips :: jsonb ? '0.0.0.0/0';

List DB instances with SSL encryption disabled

select
db_instance_id,
vpc_id,
creation_time,
engine,
ssl_encryption
from
alicloud_rds_instance
where
ssl_status = 'Disabled';

List DB instances with TDE disabled

select
db_instance_id,
vpc_id,
creation_time,
engine,
tde_status
from
alicloud_rds_instance
where
tde_status = 'Disabled';

Get security group configuration details for instances

select
i.db_instance_id,
s ->> 'NetworkType' as network_type,
s ->> 'RegionId' as security_group_region_id,
s ->> 'SecurityGroupId' as security_group_id
from
alicloud_rds_instance as i,
jsonb_array_elements(security_group_configuration) as s;

Get encryption details for all the instances

select
i.arn as instance_arn,
i.title as instance_name,
encryption_key,
k.title as kms_key_name
from
alicloud_rds_instance i
left join alicloud_kms_key k on encryption_key = key_id;

Query examples

Control examples

.inspect alicloud_rds_instance

Provides an RDS instance resource. A DB instance is an isolated database environment in the cloud. A DB instance can contain multiple user-created databases.

NameTypeDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
account_idtextThe Alicloud Account ID in which the resource is located.
account_max_quantitybigintThe maximum number of accounts that can be created on the instance.
account_typetext
advanced_featurestextAn array that consists of advanced features. The advanced features are separated by commas (,). This parameter is supported only for instances that run SQL Server.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
arntextThe Alibaba Cloud Resource Name (ARN) of the RDS instance.
auto_upgrade_minor_versiontextThe method that is used to update the minor engine version of the instance.
availability_valuetextThe availability status of the instance. Unit: %.
categorytextThe RDS edition of the instance.
collationtextThe character set collation of the instance.
connection_modetextThe connection mode of the instances.
connection_stringtextThe internal endpoint of the instance.
console_versiontextThe type of proxy that is enabled on the instance.
creation_timetimestamp with time zoneThe creation time of the Instance.
db_instance_classtextThe instance type of the instances.
db_instance_cputextThe number of CPUs that are configured for the instance.
db_instance_descriptiontextThe description of the DB Instance.
db_instance_disk_usedtext
db_instance_idtextThe ID of the single instance to query.
db_instance_memorydouble precisionThe memory capacity of the instance. Unit: MB.
db_instance_net_typetextThe ID of the resource group to which the VPC belongs.
db_instance_statustextThe status of the instances
db_instance_storagebigintThe type of storage media that is used by the instance.
db_instance_storage_typetextThe type of storage media that is used by the instance.
db_instance_typetextThe role of the instances.
db_max_quantitybigintThe maximum number of databases that can be created on the instance.
dedicated_host_group_idtextThe ID of the dedicated cluster to which the instances belong if the instances are created in a dedicated cluster.
dispense_modetext
encryption_keytextThe custom encryption key for the instance.
enginetextThe database engine that the instances run.
engine_versiontextThe version of the database engine that the instances run.
expire_timetimestamp with time zoneInstance expire time
guard_db_instance_idtextThe ID of the disaster recovery instance that is attached to the instance if a disaster recovery instance is deployed.
increment_source_db_instance_idtextThe ID of the instance from which incremental data comes. The incremental data of a disaster recovery or read-only instance comes from its primary instance. If this parameter is not returned, the instance is a primary instance.
ins_idbigint
instance_network_typetextThe network type of the instances.
ip_typetext
latest_kernel_versiontext
lock_modetextThe lock mode of the instance.
lock_reasontextThe reason why the instance is locked.
maintain_timetextThe maintenance window of the instance. The maintenance window is displayed in UTC+8 in the ApsaraDB RDS console.
master_instance_idtextThe ID of the primary instance to which the instance is attached. If this parameter is not returned, the instance is a primary instance.
max_connectionsbigintThe maximum number of concurrent connections that are allowed by the instance.
max_iopsbigintThe maximum number of I/O requests that the instance can process per second.
multiple_temp_upgradeboolean
origin_configurationtext
parametersjsonbThe list of running parameters for the instance.
pay_typetextThe billing method of the instances.
porttextThe internal port of the instance.
proxy_typebigintThe type of proxy that is enabled on the instance.
readonly_db_instance_idsjsonbAn array that consists of the IDs of the read-only instances attached to the primary instance.
regiontextThe Alicloud region in which the resource is located.
region_idtextThe ID of the region to which the instances belong.
resource_group_idtextThe ID of the resource group to which the instances belong.
security_group_configurationjsonbECS security groups that are bound to an ApsaraDB for the instance.
security_ip_modetextThe network isolation mode of the instance.
security_ipsjsonbAn array that consists of IP addresses in the IP address whitelist.
security_ips_srcjsonbAn array that consists of IP details.
sql_collector_policyjsonbThe status of the SQL Explorer (SQL Audit) feature.
sql_collector_retentionbigintThe log backup retention duration that is allowed by the SQL explorer feature on the instance.
ssl_statustextThe SSL encryption status of the Instance
super_permission_modetextIndicates whether the instance supports superuser accounts, such as the system administrator (SA) account, Active Directory (AD) account, and host account.
support_create_super_accounttext
support_upgrade_account_typetext
tagsjsonbA map of tags for the resource.
tags_srcjsonbA map of tags for the resource.
tde_statustextThe TDE status at the instance level. Valid values: Enable | Disable.
temp_db_instance_idtextThe ID of the temporary instance that is attached to the instance if a temporary instance is deployed.
temp_upgrade_recovery_classtext
temp_upgrade_recovery_cpubigint
temp_upgrade_recovery_max_connectionstext
temp_upgrade_recovery_max_iopstext
temp_upgrade_recovery_memorybigint
temp_upgrade_recovery_timetext
temp_upgrade_time_endtext
temp_upgrade_time_starttext
time_zonetextThe time zone of the instance.
titletextTitle of the resource.
vpc_cloud_instance_idtextThe ID of the cloud instance on which the specified VPC is deployed.
vpc_idtextThe ID of the VPC to which the instances belong.
vswitch_idtextThe ID of the vSwitch associated with the specified VPC.
zone_idtextThe ID of the zone to which the instances belong.