AWS::IoT::ThingPrincipalAttachment - 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).

AWS::IoT::ThingPrincipalAttachment

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

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

Syntax

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

JSON

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

YAML

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 Amazon IoT thing.

Required: Yes

Type: String

Update requires: Replacement

Examples

The following example attaches a principal to a thing.

JSON

{ "AWSTemplateFormatVersion": "2010-09-09", "Resources": { "MyTopicRule": { "Type": "AWS::IoT::TopicRule", "Properties": { "RuleName": { "Ref": "NameParameter" }, "TopicRulePayload": { "RuleDisabled": "true", "Sql": "SELECT temp FROM 'SomeTopic' WHERE temp > 60", "Actions": [ { "S3": { "BucketName": { "Ref": "MyBucket" }, "RoleArn": { "Fn::GetAtt": [ "MyRole", "Arn" ] }, "Key": "MyKey.txt" } } ] } } } } }

YAML

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