We recommend new projects start with resources from the AWS provider.
aws-native.iot.Thing
Explore with Pulumi AI
We recommend new projects start with resources from the AWS provider.
Resource Type definition for AWS::IoT::Thing
Example Usage
Example
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AwsNative = Pulumi.AwsNative;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var nameParameter = config.Require("nameParameter");
var myAttributeValueA = config.Get("myAttributeValueA") ?? "myStringA123";
var myAttributeValueB = config.Get("myAttributeValueB") ?? "myStringB123";
var myAttributeValueC = config.Get("myAttributeValueC") ?? "myStringC123";
var myThing = new AwsNative.IoT.Thing("myThing", new()
{
ThingName = nameParameter,
AttributePayload = new AwsNative.IoT.Inputs.ThingAttributePayloadArgs
{
Attributes =
{
{ "myAttributeA", myAttributeValueA },
{ "myAttributeB", myAttributeValueB },
{ "myAttributeC", myAttributeValueC },
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/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, "")
nameParameter := cfg.Require("nameParameter")
myAttributeValueA := "myStringA123"
if param := cfg.Get("myAttributeValueA"); param != "" {
myAttributeValueA = param
}
myAttributeValueB := "myStringB123"
if param := cfg.Get("myAttributeValueB"); param != "" {
myAttributeValueB = param
}
myAttributeValueC := "myStringC123"
if param := cfg.Get("myAttributeValueC"); param != "" {
myAttributeValueC = param
}
_, err := iot.NewThing(ctx, "myThing", &iot.ThingArgs{
ThingName: pulumi.String(nameParameter),
AttributePayload: &iot.ThingAttributePayloadArgs{
Attributes: pulumi.StringMap{
"myAttributeA": pulumi.String(myAttributeValueA),
"myAttributeB": pulumi.String(myAttributeValueB),
"myAttributeC": pulumi.String(myAttributeValueC),
},
},
})
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_aws_native as aws_native
config = pulumi.Config()
name_parameter = config.require("nameParameter")
my_attribute_value_a = config.get("myAttributeValueA")
if my_attribute_value_a is None:
my_attribute_value_a = "myStringA123"
my_attribute_value_b = config.get("myAttributeValueB")
if my_attribute_value_b is None:
my_attribute_value_b = "myStringB123"
my_attribute_value_c = config.get("myAttributeValueC")
if my_attribute_value_c is None:
my_attribute_value_c = "myStringC123"
my_thing = aws_native.iot.Thing("myThing",
thing_name=name_parameter,
attribute_payload={
"attributes": {
"myAttributeA": my_attribute_value_a,
"myAttributeB": my_attribute_value_b,
"myAttributeC": my_attribute_value_c,
},
})
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";
const config = new pulumi.Config();
const nameParameter = config.require("nameParameter");
const myAttributeValueA = config.get("myAttributeValueA") || "myStringA123";
const myAttributeValueB = config.get("myAttributeValueB") || "myStringB123";
const myAttributeValueC = config.get("myAttributeValueC") || "myStringC123";
const myThing = new aws_native.iot.Thing("myThing", {
thingName: nameParameter,
attributePayload: {
attributes: {
myAttributeA: myAttributeValueA,
myAttributeB: myAttributeValueB,
myAttributeC: myAttributeValueC,
},
},
});
Coming soon!
Create Thing Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Thing(name: string, args?: ThingArgs, opts?: CustomResourceOptions);
@overload
def Thing(resource_name: str,
args: Optional[ThingArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Thing(resource_name: str,
opts: Optional[ResourceOptions] = None,
attribute_payload: Optional[ThingAttributePayloadArgs] = None,
thing_name: Optional[str] = None)
func NewThing(ctx *Context, name string, args *ThingArgs, opts ...ResourceOption) (*Thing, error)
public Thing(string name, ThingArgs? args = null, CustomResourceOptions? opts = null)
type: aws-native:iot:Thing
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 ThingArgs
- 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 ThingArgs
- 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 ThingArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ThingArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ThingArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Thing Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Thing resource accepts the following input properties:
- Attribute
Payload Pulumi.Aws Native. Io T. Inputs. Thing Attribute Payload - A string that contains up to three key value pairs. Maximum length of 800. Duplicates not allowed.
- Thing
Name string The name of the thing to update.
You can't change a thing's name. To change a thing's name, you must create a new thing, give it the new name, and then delete the old thing.
- Attribute
Payload ThingAttribute Payload Args - A string that contains up to three key value pairs. Maximum length of 800. Duplicates not allowed.
- Thing
Name string The name of the thing to update.
You can't change a thing's name. To change a thing's name, you must create a new thing, give it the new name, and then delete the old thing.
- attribute
Payload ThingAttribute Payload - A string that contains up to three key value pairs. Maximum length of 800. Duplicates not allowed.
- thing
Name String The name of the thing to update.
You can't change a thing's name. To change a thing's name, you must create a new thing, give it the new name, and then delete the old thing.
- attribute
Payload ThingAttribute Payload - A string that contains up to three key value pairs. Maximum length of 800. Duplicates not allowed.
- thing
Name string The name of the thing to update.
You can't change a thing's name. To change a thing's name, you must create a new thing, give it the new name, and then delete the old thing.
- attribute_
payload ThingAttribute Payload Args - A string that contains up to three key value pairs. Maximum length of 800. Duplicates not allowed.
- thing_
name str The name of the thing to update.
You can't change a thing's name. To change a thing's name, you must create a new thing, give it the new name, and then delete the old thing.
- attribute
Payload Property Map - A string that contains up to three key value pairs. Maximum length of 800. Duplicates not allowed.
- thing
Name String The name of the thing to update.
You can't change a thing's name. To change a thing's name, you must create a new thing, give it the new name, and then delete the old thing.
Outputs
All input properties are implicitly available as output properties. Additionally, the Thing resource produces the following output properties:
Supporting Types
ThingAttributePayload, ThingAttributePayloadArgs
- Attributes Dictionary<string, string>
A JSON string containing up to three key-value pair in JSON format. For example:
{\"attributes\":{\"string1\":\"string2\"}}
- Attributes map[string]string
A JSON string containing up to three key-value pair in JSON format. For example:
{\"attributes\":{\"string1\":\"string2\"}}
- attributes Map<String,String>
A JSON string containing up to three key-value pair in JSON format. For example:
{\"attributes\":{\"string1\":\"string2\"}}
- attributes {[key: string]: string}
A JSON string containing up to three key-value pair in JSON format. For example:
{\"attributes\":{\"string1\":\"string2\"}}
- attributes Mapping[str, str]
A JSON string containing up to three key-value pair in JSON format. For example:
{\"attributes\":{\"string1\":\"string2\"}}
- attributes Map<String>
A JSON string containing up to three key-value pair in JSON format. For example:
{\"attributes\":{\"string1\":\"string2\"}}
Package Details
- Repository
- AWS Native pulumi/pulumi-aws-native
- License
- Apache-2.0
We recommend new projects start with resources from the AWS provider.