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, statusfrom alicloud_ecs_auto_provisioning_group;
select name, auto_provisioning_group_id, state, statusfrom 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_typefrom alicloud_ecs_auto_provisioning_group as apg, jsonb_array_elements(apg.instances) as ins_detail, alicloud_ecs_instance as iwhere 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_typefrom alicloud_ecs_auto_provisioning_group as apg, json_each(apg.instances) as ins_detail, alicloud_ecs_instance as iwhere 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, statusfrom alicloud_ecs_auto_provisioning_groupwhere status <> 'active';
select name, auto_provisioning_group_id, statusfrom alicloud_ecs_auto_provisioning_groupwhere status != 'active';
Schema for alicloud_ecs_auto_provisioning_group
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The Alicloud Account ID in which the resource is located. |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
allocation_strategy | text | An unique identifier for the resource. | |
auto_provisioning_group_id | text | = | An unique identifier for the resource. |
auto_provisioning_group_type | text | An unique identifier for the resource. | |
creation_time | timestamp with time zone | An unique identifier for the resource. | |
excess_capacity_termination_policy | text | An unique identifier for the resource. | |
instances | jsonb | An unique identifier for the resource. | |
launch_template_configs | jsonb | An unique identifier for the resource. | |
launch_template_id | text | An unique identifier for the resource. | |
launch_template_version | text | An unique identifier for the resource. | |
max_spot_price | double precision | An unique identifier for the resource. | |
name | text | A friendly name for the resource. | |
region | text | The Alicloud region in which the resource is located. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
spot_options | jsonb | An unique identifier for the resource. | |
state | text | An unique identifier for the resource. | |
status | text | An unique identifier for the resource. | |
target_capacity_specification | jsonb | An unique identifier for the resource. | |
terminate_instances | boolean | An unique identifier for the resource. | |
terminate_instances_with_expiration | boolean | An unique identifier for the resource. | |
title | text | Title of the resource. | |
valid_from | timestamp with time zone | An unique identifier for the resource. | |
valid_until | timestamp with time zone | An 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