1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. iot
  5. DeviceGroup
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.iot.DeviceGroup

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    Provides a Iot Device Group resource.

    For information about Iot Device Group and how to use it, see What is Device Group.

    NOTE: Available since v1.134.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "tfexample";
    const example = new alicloud.iot.DeviceGroup("example", {groupName: name});
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tfexample"
    example = alicloud.iot.DeviceGroup("example", group_name=name)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/iot"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "tfexample"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_, err := iot.NewDeviceGroup(ctx, "example", &iot.DeviceGroupArgs{
    			GroupName: pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "tfexample";
        var example = new AliCloud.Iot.DeviceGroup("example", new()
        {
            GroupName = name,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.iot.DeviceGroup;
    import com.pulumi.alicloud.iot.DeviceGroupArgs;
    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 config = ctx.config();
            final var name = config.get("name").orElse("tfexample");
            var example = new DeviceGroup("example", DeviceGroupArgs.builder()
                .groupName(name)
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: tfexample
    resources:
      example:
        type: alicloud:iot:DeviceGroup
        properties:
          groupName: ${name}
    

    Create DeviceGroup Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new DeviceGroup(name: string, args: DeviceGroupArgs, opts?: CustomResourceOptions);
    @overload
    def DeviceGroup(resource_name: str,
                    args: DeviceGroupArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def DeviceGroup(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    group_name: Optional[str] = None,
                    group_desc: Optional[str] = None,
                    iot_instance_id: Optional[str] = None,
                    super_group_id: Optional[str] = None)
    func NewDeviceGroup(ctx *Context, name string, args DeviceGroupArgs, opts ...ResourceOption) (*DeviceGroup, error)
    public DeviceGroup(string name, DeviceGroupArgs args, CustomResourceOptions? opts = null)
    public DeviceGroup(String name, DeviceGroupArgs args)
    public DeviceGroup(String name, DeviceGroupArgs args, CustomResourceOptions options)
    
    type: alicloud:iot:DeviceGroup
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args DeviceGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args DeviceGroupArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args DeviceGroupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DeviceGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DeviceGroupArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var deviceGroupResource = new AliCloud.Iot.DeviceGroup("deviceGroupResource", new()
    {
        GroupName = "string",
        GroupDesc = "string",
        IotInstanceId = "string",
        SuperGroupId = "string",
    });
    
    example, err := iot.NewDeviceGroup(ctx, "deviceGroupResource", &iot.DeviceGroupArgs{
    	GroupName:     pulumi.String("string"),
    	GroupDesc:     pulumi.String("string"),
    	IotInstanceId: pulumi.String("string"),
    	SuperGroupId:  pulumi.String("string"),
    })
    
    var deviceGroupResource = new DeviceGroup("deviceGroupResource", DeviceGroupArgs.builder()
        .groupName("string")
        .groupDesc("string")
        .iotInstanceId("string")
        .superGroupId("string")
        .build());
    
    device_group_resource = alicloud.iot.DeviceGroup("deviceGroupResource",
        group_name="string",
        group_desc="string",
        iot_instance_id="string",
        super_group_id="string")
    
    const deviceGroupResource = new alicloud.iot.DeviceGroup("deviceGroupResource", {
        groupName: "string",
        groupDesc: "string",
        iotInstanceId: "string",
        superGroupId: "string",
    });
    
    type: alicloud:iot:DeviceGroup
    properties:
        groupDesc: string
        groupName: string
        iotInstanceId: string
        superGroupId: string
    

    DeviceGroup Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The DeviceGroup resource accepts the following input properties:

    GroupName string
    The GroupName of the device group.
    GroupDesc string
    The GroupDesc of the device group.
    IotInstanceId string
    The id of the Iot Instance.
    SuperGroupId string
    The id of the SuperGroup.
    GroupName string
    The GroupName of the device group.
    GroupDesc string
    The GroupDesc of the device group.
    IotInstanceId string
    The id of the Iot Instance.
    SuperGroupId string
    The id of the SuperGroup.
    groupName String
    The GroupName of the device group.
    groupDesc String
    The GroupDesc of the device group.
    iotInstanceId String
    The id of the Iot Instance.
    superGroupId String
    The id of the SuperGroup.
    groupName string
    The GroupName of the device group.
    groupDesc string
    The GroupDesc of the device group.
    iotInstanceId string
    The id of the Iot Instance.
    superGroupId string
    The id of the SuperGroup.
    group_name str
    The GroupName of the device group.
    group_desc str
    The GroupDesc of the device group.
    iot_instance_id str
    The id of the Iot Instance.
    super_group_id str
    The id of the SuperGroup.
    groupName String
    The GroupName of the device group.
    groupDesc String
    The GroupDesc of the device group.
    iotInstanceId String
    The id of the Iot Instance.
    superGroupId String
    The id of the SuperGroup.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the DeviceGroup resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing DeviceGroup Resource

    Get an existing DeviceGroup resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: DeviceGroupState, opts?: CustomResourceOptions): DeviceGroup
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            group_desc: Optional[str] = None,
            group_name: Optional[str] = None,
            iot_instance_id: Optional[str] = None,
            super_group_id: Optional[str] = None) -> DeviceGroup
    func GetDeviceGroup(ctx *Context, name string, id IDInput, state *DeviceGroupState, opts ...ResourceOption) (*DeviceGroup, error)
    public static DeviceGroup Get(string name, Input<string> id, DeviceGroupState? state, CustomResourceOptions? opts = null)
    public static DeviceGroup get(String name, Output<String> id, DeviceGroupState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    GroupDesc string
    The GroupDesc of the device group.
    GroupName string
    The GroupName of the device group.
    IotInstanceId string
    The id of the Iot Instance.
    SuperGroupId string
    The id of the SuperGroup.
    GroupDesc string
    The GroupDesc of the device group.
    GroupName string
    The GroupName of the device group.
    IotInstanceId string
    The id of the Iot Instance.
    SuperGroupId string
    The id of the SuperGroup.
    groupDesc String
    The GroupDesc of the device group.
    groupName String
    The GroupName of the device group.
    iotInstanceId String
    The id of the Iot Instance.
    superGroupId String
    The id of the SuperGroup.
    groupDesc string
    The GroupDesc of the device group.
    groupName string
    The GroupName of the device group.
    iotInstanceId string
    The id of the Iot Instance.
    superGroupId string
    The id of the SuperGroup.
    group_desc str
    The GroupDesc of the device group.
    group_name str
    The GroupName of the device group.
    iot_instance_id str
    The id of the Iot Instance.
    super_group_id str
    The id of the SuperGroup.
    groupDesc String
    The GroupDesc of the device group.
    groupName String
    The GroupName of the device group.
    iotInstanceId String
    The id of the Iot Instance.
    superGroupId String
    The id of the SuperGroup.

    Import

    Iot Device Group can be imported using the id, e.g.

    $ pulumi import alicloud:iot/deviceGroup:DeviceGroup example <id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi