AWS CloudFormation
User Guide (API 版本 2010-05-15)
AWS 文档中描述的 AWS 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 Amazon AWS 入门

AWS::IoT::PolicyPrincipalAttachment

使用 AWS::IoT::PolicyPrincipalAttachment 资源将 AWS IoT 策略附加到委托人(X.509 证书或其他凭证)。

有关使用 AWS IoT 策略和委托人的信息,请参阅 AWS IoT 开发人员指南 中的授权

语法

JSON

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

YAML

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

属性

PolicyName

策略的名称。

Required: Yes

Type: String

更新要求替换

Principal

委托人,可以是证书 ARN(从 CreateCertificate 操作中返回)或 Amazon Cognito ID。

Required: Yes

Type: String

更新要求替换

示例

下面的示例将策略附加到委托人。

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"

本页内容: