Skip to content

Commit

Permalink
Updated the doc to match the latest doc format
Browse files Browse the repository at this point in the history
  • Loading branch information
ParthaI committed Jan 30, 2024
1 parent 0b00664 commit b8ed7c1
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 12 deletions.
8 changes: 7 additions & 1 deletion aws/table_aws_iot_thing_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ func tableAwsIotThingGroup(_ context.Context) *plugin.Table {
{Name: "parent_group_name", Require: plugin.Optional, Operators: []string{"="}},
},
},
HydrateConfig: []plugin.HydrateConfig{
{
Func: getIotThingGroup,
Tags: map[string]string{"service": "iot", "action": "DescribeThingGroup"},
},
},
GetMatrixItemFunc: SupportedRegionMatrix(iotv1.EndpointsID),
Columns: awsRegionalColumns([]*plugin.Column{
{
Expand Down Expand Up @@ -182,7 +188,7 @@ func listIotThingGroups(ctx context.Context, d *plugin.QueryData, _ *plugin.Hydr
MaxResults: aws.Int32(maxLimit),
Recursive: aws.Bool(true),
}

if d.EqualsQualString("parent_group_name") != "" {
input.ParentGroup = aws.String(d.EqualsQualString("parent_group_name"))
}
Expand Down
90 changes: 79 additions & 11 deletions docs/tables/aws_iot_thing_group.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,34 @@
# Table: aws_iot_thing_group
---
title: "Steampipe Table: aws_iot_thing_group - Query AWS IoT Thing Group using SQL"
description: "Allows users to query AWS IoT Thing Group to gain insights into each group's configuration, including ARN, creation date, version of the group, and parent of the groups."
---

An IoT Thing Group in AWS IoT Core is a logical grouping of IoT devices (Things) that allows you to manage and interact with these devices collectively. Thing Groups are part of the device management capabilities in AWS IoT Core, and they provide a way to organize your fleet of devices for easier management and control. This concept is especially useful in large-scale IoT deployments where handling devices individually is impractical.
# 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
### 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.

```sql+postgres
select
group_name,
thing_group_id,
thing_group_description,
arn,
creation_date,
parent_group_name
from
aws_iot_thing_group;
```

```sql
```sql+sqlite
select
group_name,
thing_group_id,
Expand All @@ -18,9 +40,23 @@ from
aws_iot_thing_group;
```

### Filter thing groups by parent 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.

```sql+postgres
select
group_name,
thing_group_id,
creation_date,
parent_group_name,
version
from
aws_iot_thing_group
where
parent_group_name = 'foo';
```

```sql
```sql+sqlite
select
group_name,
thing_group_id,
Expand All @@ -33,9 +69,10 @@ where
parent_group_name = 'foo';
```

### List thing groups created in the last 30 days
### 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.

```sql
```sql+postgres
select
group_name,
thing_group_id,
Expand All @@ -45,12 +82,26 @@ select
from
aws_iot_thing_group
where
creation_date >= now() - interval '30' day;
creation_date >= now() - interval '30 days';
```

### List dynamic groups
```sql+sqlite
select
group_name,
thing_group_id,
parent_group_name,
creation_date,
status
from
aws_iot_thing_group
where
datetime(creation_date) >= datetime('now', '-30 days');
```

```sql
### List Dynamic Groups
List dynamic Thing Groups in your AWS IoT environment. Dynamic groups are defined by queries and this query is particularly useful to identify groups that are automatically managed based on set criteria.

```sql+postgres
select
group_name,
thing_group_id,
Expand All @@ -62,3 +113,20 @@ from
where
status <> '';
```

```sql+sqlite
select
group_name,
thing_group_id,
query_string,
query_version,
status
from
aws_iot_thing_group
where
status <> '';
```

---

This format offers a comprehensive guide for querying AWS IoT Thing Groups using SQL, supporting various operational and management needs in IoT environments.

0 comments on commit b8ed7c1

Please sign in to comment.