AWS::IoT::PolicyPrincipalAttachment
Use the AWS::IoT::PolicyPrincipalAttachment
resource to attach an Amazon IoT policy to a principal (an X.509 certificate or other credential).
For information about working with Amazon IoT policies 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::PolicyPrincipalAttachment", "Properties" : { "PolicyName" :
String
, "Principal" :String
} }
YAML
Type: AWS::IoT::PolicyPrincipalAttachment Properties: PolicyName:
String
Principal:String
Properties
PolicyName
-
The name of the Amazon IoT 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
Examples
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