Alibaba Cloud v3.88.0 published on Saturday, Nov 1, 2025 by Pulumi
alicloud.iot.getDeviceGroups
Start a Neo task
Explain and create an alicloud.iot.getDeviceGroups resource
This data source provides the Iot Device Groups of the current Alibaba Cloud user.
NOTE: Available in v1.134.0+.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ids = alicloud.iot.getDeviceGroups({});
export const iotDeviceGroupId1 = ids.then(ids => ids.groups?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
ids = alicloud.iot.get_device_groups()
pulumi.export("iotDeviceGroupId1", ids.groups[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/iot"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
ids, err := iot.GetDeviceGroups(ctx, &iot.GetDeviceGroupsArgs{}, nil)
if err != nil {
return err
}
ctx.Export("iotDeviceGroupId1", ids.Groups[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var ids = AliCloud.Iot.GetDeviceGroups.Invoke();
return new Dictionary<string, object?>
{
["iotDeviceGroupId1"] = ids.Apply(getDeviceGroupsResult => getDeviceGroupsResult.Groups[0]?.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.iot.IotFunctions;
import com.pulumi.alicloud.iot.inputs.GetDeviceGroupsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var ids = IotFunctions.getDeviceGroups(GetDeviceGroupsArgs.builder()
.build());
ctx.export("iotDeviceGroupId1", ids.groups()[0].id());
}
}
variables:
ids:
fn::invoke:
function: alicloud:iot:getDeviceGroups
arguments: {}
outputs:
iotDeviceGroupId1: ${ids.groups[0].id}
Using getDeviceGroups
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getDeviceGroups(args: GetDeviceGroupsArgs, opts?: InvokeOptions): Promise<GetDeviceGroupsResult>
function getDeviceGroupsOutput(args: GetDeviceGroupsOutputArgs, opts?: InvokeOptions): Output<GetDeviceGroupsResult>def get_device_groups(enable_details: Optional[bool] = None,
group_name: Optional[str] = None,
ids: Optional[Sequence[str]] = None,
iot_instance_id: Optional[str] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
super_group_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetDeviceGroupsResult
def get_device_groups_output(enable_details: Optional[pulumi.Input[bool]] = None,
group_name: Optional[pulumi.Input[str]] = None,
ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
iot_instance_id: Optional[pulumi.Input[str]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
super_group_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetDeviceGroupsResult]func GetDeviceGroups(ctx *Context, args *GetDeviceGroupsArgs, opts ...InvokeOption) (*GetDeviceGroupsResult, error)
func GetDeviceGroupsOutput(ctx *Context, args *GetDeviceGroupsOutputArgs, opts ...InvokeOption) GetDeviceGroupsResultOutput> Note: This function is named GetDeviceGroups in the Go SDK.
public static class GetDeviceGroups
{
public static Task<GetDeviceGroupsResult> InvokeAsync(GetDeviceGroupsArgs args, InvokeOptions? opts = null)
public static Output<GetDeviceGroupsResult> Invoke(GetDeviceGroupsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetDeviceGroupsResult> getDeviceGroups(GetDeviceGroupsArgs args, InvokeOptions options)
public static Output<GetDeviceGroupsResult> getDeviceGroups(GetDeviceGroupsArgs args, InvokeOptions options)
fn::invoke:
function: alicloud:iot/getDeviceGroups:getDeviceGroups
arguments:
# arguments dictionaryThe following arguments are supported:
- Enable
Details bool - Default to
false. Set it totruecan output more details about resource attributes. - Group
Name string - The GroupName of the device group.
- Ids List<string>
- A list of device group IDs.
- Iot
Instance stringId - The id of the Iot Instance.
- Name
Regex string - A regex string to filter CEN instances by name.
- Output
File string - File name where to save data source results (after running
pulumi preview). - Super
Group stringId - The id of the SuperGroup.
- Enable
Details bool - Default to
false. Set it totruecan output more details about resource attributes. - Group
Name string - The GroupName of the device group.
- Ids []string
- A list of device group IDs.
- Iot
Instance stringId - The id of the Iot Instance.
- Name
Regex string - A regex string to filter CEN instances by name.
- Output
File string - File name where to save data source results (after running
pulumi preview). - Super
Group stringId - The id of the SuperGroup.
- enable
Details Boolean - Default to
false. Set it totruecan output more details about resource attributes. - group
Name String - The GroupName of the device group.
- ids List<String>
- A list of device group IDs.
- iot
Instance StringId - The id of the Iot Instance.
- name
Regex String - A regex string to filter CEN instances by name.
- output
File String - File name where to save data source results (after running
pulumi preview). - super
Group StringId - The id of the SuperGroup.
- enable
Details boolean - Default to
false. Set it totruecan output more details about resource attributes. - group
Name string - The GroupName of the device group.
- ids string[]
- A list of device group IDs.
- iot
Instance stringId - The id of the Iot Instance.
- name
Regex string - A regex string to filter CEN instances by name.
- output
File string - File name where to save data source results (after running
pulumi preview). - super
Group stringId - The id of the SuperGroup.
- enable_
details bool - Default to
false. Set it totruecan output more details about resource attributes. - group_
name str - The GroupName of the device group.
- ids Sequence[str]
- A list of device group IDs.
- iot_
instance_ strid - The id of the Iot Instance.
- name_
regex str - A regex string to filter CEN instances by name.
- output_
file str - File name where to save data source results (after running
pulumi preview). - super_
group_ strid - The id of the SuperGroup.
- enable
Details Boolean - Default to
false. Set it totruecan output more details about resource attributes. - group
Name String - The GroupName of the device group.
- ids List<String>
- A list of device group IDs.
- iot
Instance StringId - The id of the Iot Instance.
- name
Regex String - A regex string to filter CEN instances by name.
- output
File String - File name where to save data source results (after running
pulumi preview). - super
Group StringId - The id of the SuperGroup.
getDeviceGroups Result
The following output properties are available:
- Groups
List<Pulumi.
Ali Cloud. Iot. Outputs. Get Device Groups Group> - Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Enable
Details bool - Group
Name string - Iot
Instance stringId - Name
Regex string - Output
File string - Super
Group stringId
- Groups
[]Get
Device Groups Group - Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Enable
Details bool - Group
Name string - Iot
Instance stringId - Name
Regex string - Output
File string - Super
Group stringId
- groups
List<Get
Device Groups Group> - id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- enable
Details Boolean - group
Name String - iot
Instance StringId - name
Regex String - output
File String - super
Group StringId
- groups
Get
Device Groups Group[] - id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- enable
Details boolean - group
Name string - iot
Instance stringId - name
Regex string - output
File string - super
Group stringId
- groups
Sequence[Get
Device Groups Group] - id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- enable_
details bool - group_
name str - iot_
instance_ strid - name_
regex str - output_
file str - super_
group_ strid
- groups List<Property Map>
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- enable
Details Boolean - group
Name String - iot
Instance StringId - name
Regex String - output
File String - super
Group StringId
Supporting Types
GetDeviceGroupsGroup
- Create
Time string - The Group CreateTime.
- Device
Active string - The Group Number of activated devices.
- Device
Count string - The Group Total number of devices.
- Device
Online string - The Group Number of online devices.
- Error
Message string - The Error_Message of the device group.
- Group
Desc string - The GroupDesc of the device group.
- Group
Id string - The GroupId of the device group.
- Group
Name string - The GroupName of the device group.
- Id string
- The ID of the device group.
- Success bool
- Whether the call is successful.
- Create
Time string - The Group CreateTime.
- Device
Active string - The Group Number of activated devices.
- Device
Count string - The Group Total number of devices.
- Device
Online string - The Group Number of online devices.
- Error
Message string - The Error_Message of the device group.
- Group
Desc string - The GroupDesc of the device group.
- Group
Id string - The GroupId of the device group.
- Group
Name string - The GroupName of the device group.
- Id string
- The ID of the device group.
- Success bool
- Whether the call is successful.
- create
Time String - The Group CreateTime.
- device
Active String - The Group Number of activated devices.
- device
Count String - The Group Total number of devices.
- device
Online String - The Group Number of online devices.
- error
Message String - The Error_Message of the device group.
- group
Desc String - The GroupDesc of the device group.
- group
Id String - The GroupId of the device group.
- group
Name String - The GroupName of the device group.
- id String
- The ID of the device group.
- success Boolean
- Whether the call is successful.
- create
Time string - The Group CreateTime.
- device
Active string - The Group Number of activated devices.
- device
Count string - The Group Total number of devices.
- device
Online string - The Group Number of online devices.
- error
Message string - The Error_Message of the device group.
- group
Desc string - The GroupDesc of the device group.
- group
Id string - The GroupId of the device group.
- group
Name string - The GroupName of the device group.
- id string
- The ID of the device group.
- success boolean
- Whether the call is successful.
- create_
time str - The Group CreateTime.
- device_
active str - The Group Number of activated devices.
- device_
count str - The Group Total number of devices.
- device_
online str - The Group Number of online devices.
- error_
message str - The Error_Message of the device group.
- group_
desc str - The GroupDesc of the device group.
- group_
id str - The GroupId of the device group.
- group_
name str - The GroupName of the device group.
- id str
- The ID of the device group.
- success bool
- Whether the call is successful.
- create
Time String - The Group CreateTime.
- device
Active String - The Group Number of activated devices.
- device
Count String - The Group Total number of devices.
- device
Online String - The Group Number of online devices.
- error
Message String - The Error_Message of the device group.
- group
Desc String - The GroupDesc of the device group.
- group
Id String - The GroupId of the device group.
- group
Name String - The GroupName of the device group.
- id String
- The ID of the device group.
- success Boolean
- Whether the call is successful.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.
