turbot/alicloud
steampipe plugin install alicloud

Table: alicloud_ecs_auto_provisioning_group - Query Alicloud ECS Auto Provisioning Groups using SQL

Alicloud Elastic Compute Service (ECS) Auto Provisioning Groups are a feature that enables automatic creation and release of ECS instances based on specified rules. This feature helps to simplify capacity management and reduce costs by automatically adjusting the number of instances based on the real-time business needs.

Table Usage Guide

The alicloud_ecs_auto_provisioning_group table provides insights into the auto provisioning groups within Alicloud Elastic Compute Service (ECS). As a system administrator or DevOps engineer, you can explore group-specific details through this table, including configuration, status, and instance information. Use it to manage your ECS resources efficiently, ensuring optimal capacity and cost-effectiveness.

Examples

Basic info

Explore which auto-provisioning groups in the Alibaba Cloud Elastic Compute Service are active or inactive. This can help in managing resources and ensuring optimal performance.

select
name,
auto_provisioning_group_id,
state,
status
from
alicloud_ecs_auto_provisioning_group;
select
name,
auto_provisioning_group_id,
state,
status
from
alicloud_ecs_auto_provisioning_group;

Get instance details for a specific group

Explore the specific details of instances within a certain group. This query is beneficial for understanding the settings and statuses of these instances, allowing for more informed management and troubleshooting decisions.

select
apg.name as auto_provisioning_group_name,
apg.launch_template_id as launch_template_id,
apg.launch_template_version as launch_template_version,
i.instance_type,
i.os_name_en,
i.private_ip_address,
i.public_ip_address,
ins_detail ->> 'InstanceId' as instance_id,
ins_detail ->> 'InstanceType' as instance_type,
ins_detail ->> 'Status' as instance_status,
ins_detail ->> 'NetworkType' as instance_network_type
from
alicloud_ecs_auto_provisioning_group as apg,
jsonb_array_elements(apg.instances) as ins_detail,
alicloud_ecs_instance as i
where
ins_detail ->> 'InstanceId' = i.instance_id
and apg.name = 'my_group';
select
apg.name as auto_provisioning_group_name,
apg.launch_template_id as launch_template_id,
apg.launch_template_version as launch_template_version,
i.instance_type,
i.os_name_en,
i.private_ip_address,
i.public_ip_address,
json_extract(ins_detail.value, '$.InstanceId') as instance_id,
json_extract(ins_detail.value, '$.InstanceType') as instance_type,
json_extract(ins_detail.value, '$.Status') as instance_status,
json_extract(ins_detail.value, '$.NetworkType') as instance_network_type
from
alicloud_ecs_auto_provisioning_group as apg,
json_each(apg.instances) as ins_detail,
alicloud_ecs_instance as i
where
json_extract(ins_detail.value, '$.InstanceId') = i.instance_id
and apg.name = 'my_group';

List inactive groups

Discover the segments that are not currently active within your auto provisioning groups. This could be useful for auditing resources, managing costs, or identifying potential issues in your infrastructure.

select
name,
auto_provisioning_group_id,
status
from
alicloud_ecs_auto_provisioning_group
where
status <> 'active';
select
name,
auto_provisioning_group_id,
status
from
alicloud_ecs_auto_provisioning_group
where
status != 'active';

Schema for alicloud_ecs_auto_provisioning_group

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
account_idtext=, !=, ~~, ~~*, !~~, !~~*The Alicloud Account ID in which the resource is located.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
allocation_strategytextAn unique identifier for the resource.
auto_provisioning_group_idtext=An unique identifier for the resource.
auto_provisioning_group_typetextAn unique identifier for the resource.
creation_timetimestamp with time zoneAn unique identifier for the resource.
excess_capacity_termination_policytextAn unique identifier for the resource.
instancesjsonbAn unique identifier for the resource.
launch_template_configsjsonbAn unique identifier for the resource.
launch_template_idtextAn unique identifier for the resource.
launch_template_versiontextAn unique identifier for the resource.
max_spot_pricedouble precisionAn unique identifier for the resource.
nametextA friendly name for the resource.
regiontextThe Alicloud region in which the resource is located.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
spot_optionsjsonbAn unique identifier for the resource.
statetextAn unique identifier for the resource.
statustextAn unique identifier for the resource.
target_capacity_specificationjsonbAn unique identifier for the resource.
terminate_instancesbooleanAn unique identifier for the resource.
terminate_instances_with_expirationbooleanAn unique identifier for the resource.
titletextTitle of the resource.
valid_fromtimestamp with time zoneAn unique identifier for the resource.
valid_untiltimestamp with time zoneAn unique identifier for the resource.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- alicloud

You can pass the configuration to the command with the --config argument:

steampipe_export_alicloud --config '<your_config>' alicloud_ecs_auto_provisioning_group