alicloud logo
Alibaba Cloud v3.34.0, Mar 17 23

alicloud.iot.getDeviceGroups

This data source provides the Iot Device Groups of the current Alibaba Cloud user.

NOTE: Available in v1.134.0+.

Example Usage

Basic Usage

using System.Collections.Generic;
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 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, nil, nil)
		if err != nil {
			return err
		}
		ctx.Export("iotDeviceGroupId1", ids.Groups[0].Id)
		return nil
	})
}
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();

        ctx.export("iotDeviceGroupId1", ids.applyValue(getDeviceGroupsResult -> getDeviceGroupsResult.groups()[0].id()));
    }
}
import pulumi
import pulumi_alicloud as alicloud

ids = alicloud.iot.get_device_groups()
pulumi.export("iotDeviceGroupId1", ids.groups[0].id)
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);
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)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: alicloud:iot/getDeviceGroups:getDeviceGroups
  arguments:
    # arguments dictionary

The following arguments are supported:

EnableDetails bool

Default to false. Set it to true can output more details about resource attributes.

GroupName string

The GroupName of the device group.

Ids List<string>

A list of device group IDs.

IotInstanceId string

The id of the Iot Instance.

NameRegex string

A regex string to filter CEN instances by name.

OutputFile string
SuperGroupId string

The id of the SuperGroup.

EnableDetails bool

Default to false. Set it to true can output more details about resource attributes.

GroupName string

The GroupName of the device group.

Ids []string

A list of device group IDs.

IotInstanceId string

The id of the Iot Instance.

NameRegex string

A regex string to filter CEN instances by name.

OutputFile string
SuperGroupId string

The id of the SuperGroup.

enableDetails Boolean

Default to false. Set it to true can output more details about resource attributes.

groupName String

The GroupName of the device group.

ids List<String>

A list of device group IDs.

iotInstanceId String

The id of the Iot Instance.

nameRegex String

A regex string to filter CEN instances by name.

outputFile String
superGroupId String

The id of the SuperGroup.

enableDetails boolean

Default to false. Set it to true can output more details about resource attributes.

groupName string

The GroupName of the device group.

ids string[]

A list of device group IDs.

iotInstanceId string

The id of the Iot Instance.

nameRegex string

A regex string to filter CEN instances by name.

outputFile string
superGroupId string

The id of the SuperGroup.

enable_details bool

Default to false. Set it to true can 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_id str

The id of the Iot Instance.

name_regex str

A regex string to filter CEN instances by name.

output_file str
super_group_id str

The id of the SuperGroup.

enableDetails Boolean

Default to false. Set it to true can output more details about resource attributes.

groupName String

The GroupName of the device group.

ids List<String>

A list of device group IDs.

iotInstanceId String

The id of the Iot Instance.

nameRegex String

A regex string to filter CEN instances by name.

outputFile String
superGroupId String

The id of the SuperGroup.

getDeviceGroups Result

The following output properties are available:

Groups List<Pulumi.AliCloud.Iot.Outputs.GetDeviceGroupsGroup>
Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>
EnableDetails bool
GroupName string
IotInstanceId string
NameRegex string
OutputFile string
SuperGroupId string
Groups []GetDeviceGroupsGroup
Id string

The provider-assigned unique ID for this managed resource.

Ids []string
EnableDetails bool
GroupName string
IotInstanceId string
NameRegex string
OutputFile string
SuperGroupId string
groups List<GetDeviceGroupsGroup>
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
enableDetails Boolean
groupName String
iotInstanceId String
nameRegex String
outputFile String
superGroupId String
groups GetDeviceGroupsGroup[]
id string

The provider-assigned unique ID for this managed resource.

ids string[]
enableDetails boolean
groupName string
iotInstanceId string
nameRegex string
outputFile string
superGroupId string
groups Sequence[GetDeviceGroupsGroup]
id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]
enable_details bool
group_name str
iot_instance_id str
name_regex str
output_file str
super_group_id str
groups List<Property Map>
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
enableDetails Boolean
groupName String
iotInstanceId String
nameRegex String
outputFile String
superGroupId String

Supporting Types

GetDeviceGroupsGroup

CreateTime string

The Group CreateTime.

DeviceActive string

The Group Number of activated devices.

DeviceCount string

The Group Total number of devices.

DeviceOnline string

The Group Number of online devices.

ErrorMessage string

The Error_Message of the device group.

GroupDesc string

The GroupDesc of the device group.

GroupId string

The GroupId of the device group.

GroupName string

The GroupName of the device group.

Id string

The ID of the device group.

Success bool

Whether the call is successful.

CreateTime string

The Group CreateTime.

DeviceActive string

The Group Number of activated devices.

DeviceCount string

The Group Total number of devices.

DeviceOnline string

The Group Number of online devices.

ErrorMessage string

The Error_Message of the device group.

GroupDesc string

The GroupDesc of the device group.

GroupId string

The GroupId of the device group.

GroupName string

The GroupName of the device group.

Id string

The ID of the device group.

Success bool

Whether the call is successful.

createTime String

The Group CreateTime.

deviceActive String

The Group Number of activated devices.

deviceCount String

The Group Total number of devices.

deviceOnline String

The Group Number of online devices.

errorMessage String

The Error_Message of the device group.

groupDesc String

The GroupDesc of the device group.

groupId String

The GroupId of the device group.

groupName String

The GroupName of the device group.

id String

The ID of the device group.

success Boolean

Whether the call is successful.

createTime string

The Group CreateTime.

deviceActive string

The Group Number of activated devices.

deviceCount string

The Group Total number of devices.

deviceOnline string

The Group Number of online devices.

errorMessage string

The Error_Message of the device group.

groupDesc string

The GroupDesc of the device group.

groupId string

The GroupId of the device group.

groupName 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.

createTime String

The Group CreateTime.

deviceActive String

The Group Number of activated devices.

deviceCount String

The Group Total number of devices.

deviceOnline String

The Group Number of online devices.

errorMessage String

The Error_Message of the device group.

groupDesc String

The GroupDesc of the device group.

groupId String

The GroupId of the device group.

groupName 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 alicloud Terraform Provider.