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

AWS::IoT::PolicyPrincipalAttachment

Use the AWS::IoT::PolicyPrincipalAttachment resource to attach an AWS IoT policy to a principal (an X.509 certificate or other credential).

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

Syntax

JSON

{ "Type": "AWS::IoT::PolicyPrincipalAttachment", "Properties": { "PolicyName": String, "Principal": String } }

YAML

Type: "AWS::IoT::PolicyPrincipalAttachment" Properties: PolicyName: String Principal: String

Properties

PolicyName

The name of the policy.

Required: Yes

Type: String

Update requires: Replacement

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

Example

The following example attaches a policy to a principal.

JSON

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

YAML

AWSTemplateFormatVersion: "2010-09-09" Resources: MyPolicyPrincipalAttachment: Type: "AWS::IoT::PolicyPrincipalAttachment" Properties: PolicyName: Ref: "NameParameter" Principal: "arn:aws:iot:ap-southeast-2:123456789012:cert/a1234567b89c012d3e4fg567hij8k9l01mno1p23q45678901rs234567890t1u2" Parameters: NameParameter: Type: "String"

On this page: