AWS::IoT::Thing - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).


Use the AWS::IoT::Thing resource to declare an Amazon IoT thing.

For information about working with things, see How Amazon IoT Works and Device Registry for Amazon IoT in the Amazon IoT Developer Guide.


To declare this entity in your Amazon CloudFormation template, use the following syntax:


{ "Type" : "AWS::IoT::Thing", "Properties" : { "AttributePayload" : AttributePayload, "ThingName" : String } }


Type: AWS::IoT::Thing Properties: AttributePayload: AttributePayload ThingName: String



A string that contains up to three key value pairs. Maximum length of 800. Duplicates not allowed.

Required: No

Type: AttributePayload

Update requires: No interruption


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.

Required: No

Type: String

Pattern: [a-zA-Z0-9:_-]+

Minimum: 1

Maximum: 128

Update requires: Replacement

Return values


When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the thing name. For example:

{ "Ref": "MyThing" }

For a stack named MyStack, a value similar to the following is returned:


For more information about using the Ref function, see Ref.


The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.


The Amazon Resource Name (ARN) of the Amazon IoT thing, such as arn:aws:iot:us-east-2:123456789012:thing/MyThing.


The Id of this thing.


The following example declares a thing and the values of its attributes.


{ "AWSTemplateFormatVersion":"2010-09-09", "Resources":{ "MyThing":{ "Type":"AWS::IoT::Thing", "Properties":{ "ThingName":{ "Ref":"NameParameter" }, "AttributePayload":{ "Attributes":{ "myAttributeA":{ "Ref":"MyAttributeValueA" }, "myAttributeB":{ "Ref":"MyAttributeValueB" }, "myAttributeC":{ "Ref":"MyAttributeValueC" } } } } } }, "Parameters":{ "NameParameter":{ "Type":"String" }, "MyAttributeValueA":{ "Type":"String", "Default":"myStringA123" }, "MyAttributeValueB":{ "Type":"String", "Default":"myStringB123" }, "MyAttributeValueC":{ "Type":"String", "Default":"myStringC123" } } }


AWSTemplateFormatVersion: '2010-09-09' Resources: MyThing: Type: AWS::IoT::Thing Properties: ThingName: Ref: NameParameter AttributePayload: Attributes: myAttributeA: Ref: MyAttributeValueA myAttributeB: Ref: MyAttributeValueB myAttributeC: Ref: MyAttributeValueC Parameters: NameParameter: Type: String MyAttributeValueA: Type: String Default: myStringA123 MyAttributeValueB: Type: String Default: myStringB123 MyAttributeValueC: Type: String Default: myStringC123