Menu
AWS CloudFormation
User Guide (API Version 2010-05-15)

AWS::IoT::ThingPrincipalAttachment

Use the AWS::IoT::ThingPrincipalAttachment resource to attach a principal (an X.509 certificate or another credential) to a thing.

For information about working with AWS IoT things and principals, see Authorization in the AWS IoT Developer Guide.

Syntax

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

JSON

Copy
{ "Type": "AWS::IoT::ThingPrincipalAttachment", "Properties": { "Principal": String, "ThingName": String } }

YAML

Copy
Type: "AWS::IoT::ThingPrincipalAttachment" Properties: Principal: String ThingName: String

Properties

Principal

The principal, which can be a certificate ARN (as returned from the CreateCertificate operation) or an Amazon Cognito ID.

Required: Yes

Type: String

Update requires: Replacement

ThingName

The name of the AWS IoT thing.

Required: Yes

Type: String

Update requires: Replacement

Example

The following example attaches a principal to a thing.

JSON

Copy
{ "AWSTemplateFormatVersion": "2010-09-09", "Resources": { "MyThingPrincipalAttachment": { "Type": "AWS::IoT::ThingPrincipalAttachment", "Properties": { "ThingName": { "Ref": "NameParameter" }, "Principal": "arn:aws:iot:ap-southeast-2:123456789012:cert/a1234567b89c012d3e4fg567hij8k9l01mno1p23q45678901rs234567890t1u2" } } }, "Parameters": { "NameParameter": { "Type": "String" } } }

YAML

Copy
AWSTemplateFormatVersion: "2010-09-09" Resources: MyThingPrincipalAttachment: Type: "AWS::IoT::ThingPrincipalAttachment" Properties: ThingName: Ref: "NameParameter" Principal: "arn:aws:iot:ap-southeast-2:123456789012:cert/a1234567b89c012d3e4fg567hij8k9l01mno1p23q45678901rs234567890t1u2" Parameters: NameParameter: Type: "String"

On this page: