Try AWS Native preview for resources not in the classic version.
aws.iot.ThingGroup
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
Manages an AWS IoT Thing Group.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const parent = new aws.iot.ThingGroup("parent", {name: "parent"});
const example = new aws.iot.ThingGroup("example", {
name: "example",
parentGroupName: parent.name,
properties: {
attributePayload: {
attributes: {
One: "11111",
Two: "TwoTwo",
},
},
description: "This is my thing group",
},
tags: {
managed: "true",
},
});
import pulumi
import pulumi_aws as aws
parent = aws.iot.ThingGroup("parent", name="parent")
example = aws.iot.ThingGroup("example",
name="example",
parent_group_name=parent.name,
properties={
"attributePayload": {
"attributes": {
"One": "11111",
"Two": "TwoTwo",
},
},
"description": "This is my thing group",
},
tags={
"managed": "true",
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iot"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
parent, err := iot.NewThingGroup(ctx, "parent", &iot.ThingGroupArgs{
Name: pulumi.String("parent"),
})
if err != nil {
return err
}
_, err = iot.NewThingGroup(ctx, "example", &iot.ThingGroupArgs{
Name: pulumi.String("example"),
ParentGroupName: parent.Name,
Properties: &iot.ThingGroupPropertiesArgs{
AttributePayload: &iot.ThingGroupPropertiesAttributePayloadArgs{
Attributes: pulumi.StringMap{
"One": pulumi.String("11111"),
"Two": pulumi.String("TwoTwo"),
},
},
Description: pulumi.String("This is my thing group"),
},
Tags: pulumi.StringMap{
"managed": pulumi.String("true"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var parent = new Aws.Iot.ThingGroup("parent", new()
{
Name = "parent",
});
var example = new Aws.Iot.ThingGroup("example", new()
{
Name = "example",
ParentGroupName = parent.Name,
Properties = new Aws.Iot.Inputs.ThingGroupPropertiesArgs
{
AttributePayload = new Aws.Iot.Inputs.ThingGroupPropertiesAttributePayloadArgs
{
Attributes =
{
{ "One", "11111" },
{ "Two", "TwoTwo" },
},
},
Description = "This is my thing group",
},
Tags =
{
{ "managed", "true" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iot.ThingGroup;
import com.pulumi.aws.iot.ThingGroupArgs;
import com.pulumi.aws.iot.inputs.ThingGroupPropertiesArgs;
import com.pulumi.aws.iot.inputs.ThingGroupPropertiesAttributePayloadArgs;
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) {
var parent = new ThingGroup("parent", ThingGroupArgs.builder()
.name("parent")
.build());
var example = new ThingGroup("example", ThingGroupArgs.builder()
.name("example")
.parentGroupName(parent.name())
.properties(ThingGroupPropertiesArgs.builder()
.attributePayload(ThingGroupPropertiesAttributePayloadArgs.builder()
.attributes(Map.ofEntries(
Map.entry("One", "11111"),
Map.entry("Two", "TwoTwo")
))
.build())
.description("This is my thing group")
.build())
.tags(Map.of("managed", "true"))
.build());
}
}
resources:
parent:
type: aws:iot:ThingGroup
properties:
name: parent
example:
type: aws:iot:ThingGroup
properties:
name: example
parentGroupName: ${parent.name}
properties:
attributePayload:
attributes:
One: '11111'
Two: TwoTwo
description: This is my thing group
tags:
managed: 'true'
Create ThingGroup Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ThingGroup(name: string, args?: ThingGroupArgs, opts?: CustomResourceOptions);
@overload
def ThingGroup(resource_name: str,
args: Optional[ThingGroupArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def ThingGroup(resource_name: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None,
parent_group_name: Optional[str] = None,
properties: Optional[ThingGroupPropertiesArgs] = None,
tags: Optional[Mapping[str, str]] = None)
func NewThingGroup(ctx *Context, name string, args *ThingGroupArgs, opts ...ResourceOption) (*ThingGroup, error)
public ThingGroup(string name, ThingGroupArgs? args = null, CustomResourceOptions? opts = null)
public ThingGroup(String name, ThingGroupArgs args)
public ThingGroup(String name, ThingGroupArgs args, CustomResourceOptions options)
type: aws:iot:ThingGroup
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 ThingGroupArgs
- 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 ThingGroupArgs
- 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 ThingGroupArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ThingGroupArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ThingGroupArgs
- 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 thingGroupResource = new Aws.Iot.ThingGroup("thingGroupResource", new()
{
Name = "string",
ParentGroupName = "string",
Properties = new Aws.Iot.Inputs.ThingGroupPropertiesArgs
{
AttributePayload = new Aws.Iot.Inputs.ThingGroupPropertiesAttributePayloadArgs
{
Attributes =
{
{ "string", "string" },
},
},
Description = "string",
},
Tags =
{
{ "string", "string" },
},
});
example, err := iot.NewThingGroup(ctx, "thingGroupResource", &iot.ThingGroupArgs{
Name: pulumi.String("string"),
ParentGroupName: pulumi.String("string"),
Properties: &iot.ThingGroupPropertiesArgs{
AttributePayload: &iot.ThingGroupPropertiesAttributePayloadArgs{
Attributes: pulumi.StringMap{
"string": pulumi.String("string"),
},
},
Description: pulumi.String("string"),
},
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var thingGroupResource = new ThingGroup("thingGroupResource", ThingGroupArgs.builder()
.name("string")
.parentGroupName("string")
.properties(ThingGroupPropertiesArgs.builder()
.attributePayload(ThingGroupPropertiesAttributePayloadArgs.builder()
.attributes(Map.of("string", "string"))
.build())
.description("string")
.build())
.tags(Map.of("string", "string"))
.build());
thing_group_resource = aws.iot.ThingGroup("thingGroupResource",
name="string",
parent_group_name="string",
properties={
"attributePayload": {
"attributes": {
"string": "string",
},
},
"description": "string",
},
tags={
"string": "string",
})
const thingGroupResource = new aws.iot.ThingGroup("thingGroupResource", {
name: "string",
parentGroupName: "string",
properties: {
attributePayload: {
attributes: {
string: "string",
},
},
description: "string",
},
tags: {
string: "string",
},
});
type: aws:iot:ThingGroup
properties:
name: string
parentGroupName: string
properties:
attributePayload:
attributes:
string: string
description: string
tags:
string: string
ThingGroup 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 ThingGroup resource accepts the following input properties:
- Name string
- The name of the Thing Group.
- Parent
Group stringName - The name of the parent Thing Group.
- Properties
Thing
Group Properties - The Thing Group properties. Defined below.
- Dictionary<string, string>
- Key-value mapping of resource tags
- Name string
- The name of the Thing Group.
- Parent
Group stringName - The name of the parent Thing Group.
- Properties
Thing
Group Properties Args - The Thing Group properties. Defined below.
- map[string]string
- Key-value mapping of resource tags
- name String
- The name of the Thing Group.
- parent
Group StringName - The name of the parent Thing Group.
- properties
Thing
Group Properties - The Thing Group properties. Defined below.
- Map<String,String>
- Key-value mapping of resource tags
- name string
- The name of the Thing Group.
- parent
Group stringName - The name of the parent Thing Group.
- properties
Thing
Group Properties - The Thing Group properties. Defined below.
- {[key: string]: string}
- Key-value mapping of resource tags
- name str
- The name of the Thing Group.
- parent_
group_ strname - The name of the parent Thing Group.
- properties
Thing
Group Properties Args - The Thing Group properties. Defined below.
- Mapping[str, str]
- Key-value mapping of resource tags
- name String
- The name of the Thing Group.
- parent
Group StringName - The name of the parent Thing Group.
- properties Property Map
- The Thing Group properties. Defined below.
- Map<String>
- Key-value mapping of resource tags
Outputs
All input properties are implicitly available as output properties. Additionally, the ThingGroup resource produces the following output properties:
- Arn string
- The ARN of the Thing Group.
- Id string
- The provider-assigned unique ID for this managed resource.
- Metadatas
List<Thing
Group Metadata> - Dictionary<string, string>
- Version int
- The current version of the Thing Group record in the registry.
- Arn string
- The ARN of the Thing Group.
- Id string
- The provider-assigned unique ID for this managed resource.
- Metadatas
[]Thing
Group Metadata - map[string]string
- Version int
- The current version of the Thing Group record in the registry.
- arn String
- The ARN of the Thing Group.
- id String
- The provider-assigned unique ID for this managed resource.
- metadatas
List<Thing
Group Metadata> - Map<String,String>
- version Integer
- The current version of the Thing Group record in the registry.
- arn string
- The ARN of the Thing Group.
- id string
- The provider-assigned unique ID for this managed resource.
- metadatas
Thing
Group Metadata[] - {[key: string]: string}
- version number
- The current version of the Thing Group record in the registry.
- arn str
- The ARN of the Thing Group.
- id str
- The provider-assigned unique ID for this managed resource.
- metadatas
Sequence[Thing
Group Metadata] - Mapping[str, str]
- version int
- The current version of the Thing Group record in the registry.
- arn String
- The ARN of the Thing Group.
- id String
- The provider-assigned unique ID for this managed resource.
- metadatas List<Property Map>
- Map<String>
- version Number
- The current version of the Thing Group record in the registry.
Look up Existing ThingGroup Resource
Get an existing ThingGroup 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?: ThingGroupState, opts?: CustomResourceOptions): ThingGroup
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
metadatas: Optional[Sequence[ThingGroupMetadataArgs]] = None,
name: Optional[str] = None,
parent_group_name: Optional[str] = None,
properties: Optional[ThingGroupPropertiesArgs] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None,
version: Optional[int] = None) -> ThingGroup
func GetThingGroup(ctx *Context, name string, id IDInput, state *ThingGroupState, opts ...ResourceOption) (*ThingGroup, error)
public static ThingGroup Get(string name, Input<string> id, ThingGroupState? state, CustomResourceOptions? opts = null)
public static ThingGroup get(String name, Output<String> id, ThingGroupState 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.
- Arn string
- The ARN of the Thing Group.
- Metadatas
List<Thing
Group Metadata> - Name string
- The name of the Thing Group.
- Parent
Group stringName - The name of the parent Thing Group.
- Properties
Thing
Group Properties - The Thing Group properties. Defined below.
- Dictionary<string, string>
- Key-value mapping of resource tags
- Dictionary<string, string>
- Version int
- The current version of the Thing Group record in the registry.
- Arn string
- The ARN of the Thing Group.
- Metadatas
[]Thing
Group Metadata Args - Name string
- The name of the Thing Group.
- Parent
Group stringName - The name of the parent Thing Group.
- Properties
Thing
Group Properties Args - The Thing Group properties. Defined below.
- map[string]string
- Key-value mapping of resource tags
- map[string]string
- Version int
- The current version of the Thing Group record in the registry.
- arn String
- The ARN of the Thing Group.
- metadatas
List<Thing
Group Metadata> - name String
- The name of the Thing Group.
- parent
Group StringName - The name of the parent Thing Group.
- properties
Thing
Group Properties - The Thing Group properties. Defined below.
- Map<String,String>
- Key-value mapping of resource tags
- Map<String,String>
- version Integer
- The current version of the Thing Group record in the registry.
- arn string
- The ARN of the Thing Group.
- metadatas
Thing
Group Metadata[] - name string
- The name of the Thing Group.
- parent
Group stringName - The name of the parent Thing Group.
- properties
Thing
Group Properties - The Thing Group properties. Defined below.
- {[key: string]: string}
- Key-value mapping of resource tags
- {[key: string]: string}
- version number
- The current version of the Thing Group record in the registry.
- arn str
- The ARN of the Thing Group.
- metadatas
Sequence[Thing
Group Metadata Args] - name str
- The name of the Thing Group.
- parent_
group_ strname - The name of the parent Thing Group.
- properties
Thing
Group Properties Args - The Thing Group properties. Defined below.
- Mapping[str, str]
- Key-value mapping of resource tags
- Mapping[str, str]
- version int
- The current version of the Thing Group record in the registry.
- arn String
- The ARN of the Thing Group.
- metadatas List<Property Map>
- name String
- The name of the Thing Group.
- parent
Group StringName - The name of the parent Thing Group.
- properties Property Map
- The Thing Group properties. Defined below.
- Map<String>
- Key-value mapping of resource tags
- Map<String>
- version Number
- The current version of the Thing Group record in the registry.
Supporting Types
ThingGroupMetadata, ThingGroupMetadataArgs
- Creation
Date string - Parent
Group stringName - The name of the parent Thing Group.
- Root
To List<ThingParent Groups Group Metadata Root To Parent Group>
- Creation
Date string - Parent
Group stringName - The name of the parent Thing Group.
- Root
To []ThingParent Groups Group Metadata Root To Parent Group
- creation
Date String - parent
Group StringName - The name of the parent Thing Group.
- root
To List<ThingParent Groups Group Metadata Root To Parent Group>
- creation
Date string - parent
Group stringName - The name of the parent Thing Group.
- root
To ThingParent Groups Group Metadata Root To Parent Group[]
- creation_
date str - parent_
group_ strname - The name of the parent Thing Group.
- root_
to_ Sequence[Thingparent_ groups Group Metadata Root To Parent Group]
- creation
Date String - parent
Group StringName - The name of the parent Thing Group.
- root
To List<Property Map>Parent Groups
ThingGroupMetadataRootToParentGroup, ThingGroupMetadataRootToParentGroupArgs
- group_
arn str - group_
name str
ThingGroupProperties, ThingGroupPropertiesArgs
- Attribute
Payload ThingGroup Properties Attribute Payload - The Thing Group attributes. Defined below.
- Description string
- A description of the Thing Group.
- Attribute
Payload ThingGroup Properties Attribute Payload - The Thing Group attributes. Defined below.
- Description string
- A description of the Thing Group.
- attribute
Payload ThingGroup Properties Attribute Payload - The Thing Group attributes. Defined below.
- description String
- A description of the Thing Group.
- attribute
Payload ThingGroup Properties Attribute Payload - The Thing Group attributes. Defined below.
- description string
- A description of the Thing Group.
- attribute_
payload ThingGroup Properties Attribute Payload - The Thing Group attributes. Defined below.
- description str
- A description of the Thing Group.
- attribute
Payload Property Map - The Thing Group attributes. Defined below.
- description String
- A description of the Thing Group.
ThingGroupPropertiesAttributePayload, ThingGroupPropertiesAttributePayloadArgs
- Attributes Dictionary<string, string>
- Key-value map.
- Attributes map[string]string
- Key-value map.
- attributes Map<String,String>
- Key-value map.
- attributes {[key: string]: string}
- Key-value map.
- attributes Mapping[str, str]
- Key-value map.
- attributes Map<String>
- Key-value map.
Import
Using pulumi import
, import IoT Things Groups using the name. For example:
$ pulumi import aws:iot/thingGroup:ThingGroup example example
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.