Table: aws_iot_thing_group - Query AWS IoT Thing Groups using SQL
In AWS IoT Core, an IoT Thing Group is a logical collection of IoT devices (Things) that enables collective management and interaction. These groups are integral to AWS IoT Core's device management capabilities, allowing for organized, efficient control and management of device fleets. This is particularly advantageous in large-scale IoT deployments where individual device management is not feasible.
Table Usage Guide
The aws_iot_thing_group
table can be utilized to obtain detailed information about IoT Thing Groups. This includes their names, IDs, descriptions, and hierarchical structures. This table is essential for IoT administrators and developers for effective organization and oversight of groups of IoT devices within AWS.
Examples
Basic info
Acquire essential details about AWS IoT Thing Groups, including their names, IDs, descriptions, and hierarchical relationships. This fundamental query is crucial for an overview of the groups and their structures.
select group_name, thing_group_id, thing_group_description, arn, creation_date, parent_group_namefrom aws_iot_thing_group;
select group_name, thing_group_id, thing_group_description, arn, creation_date, parent_group_namefrom aws_iot_thing_group;
Filter thing groups by parent group
Identify specific IoT Thing Groups based on their parent group. This query is useful for analyzing the hierarchical organization of your IoT devices.
select group_name, thing_group_id, creation_date, parent_group_name, versionfrom aws_iot_thing_groupwhere parent_group_name = 'foo';
select group_name, thing_group_id, creation_date, parent_group_name, versionfrom aws_iot_thing_groupwhere parent_group_name = 'foo';
List thing groups created in the last 30 days
Discover Thing Groups that have been created in the last 30 days. This query helps in tracking recent additions to your IoT environment.
select group_name, thing_group_id, parent_group_name, creation_date, statusfrom aws_iot_thing_groupwhere creation_date >= now() - interval '30 days';
select group_name, thing_group_id, parent_group_name, creation_date, statusfrom aws_iot_thing_groupwhere datetime(creation_date) >= datetime('now', '-30 days');
List active thing groups
List Thing Groups that are currently being used to manage and organize devices (referred to as "things") within your IoT environment.
select group_name, thing_group_id, query_string, query_version, statusfrom aws_iot_thing_groupwhere status = 'ACTIVE';
select group_name, thing_group_id, query_string, query_version, statusfrom aws_iot_thing_groupwhere status = 'ACTIVE';
Schema for aws_iot_thing_group
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The AWS Account ID in which the resource is located. |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
arn | text | The Amazon Resource Name (ARN) for the thing group. | |
attribute_payload | jsonb | The thing group attributes in JSON format. | |
creation_date | timestamp with time zone | The UNIX timestamp of when the thing group was created. | |
group_name | text | = | The group name. |
index_name | text | The dynamic thing group index name. | |
parent_group_name | text | = | The parent thing group name. |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
query_string | text | The dynamic thing group search query string. | |
query_version | text | The dynamic thing group query version. | |
region | text | The AWS Region in which the resource is located. | |
root_to_parent_thing_groups | jsonb | The root parent thing group. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
status | text | The dynamic thing group status. | |
tags | jsonb | A map of tags for the resource. | |
tags_src | jsonb | A list of tags currently associated with the thing group. | |
thing_group_description | text | The thing group description. | |
thing_group_id | text | The thing group ID. | |
title | text | Title of the resource. | |
version | bigint | The version of the thing group. |
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)" -- aws
You can pass the configuration to the command with the --config
argument:
steampipe_export_aws --config '<your_config>' aws_iot_thing_group