AWS CloudFormation
User Guide (API Version 2010-05-15)
AWS 服务或AWS文档中描述的功能,可能因地区/位置而异。请点击 Amazon AWS 入门,可查看中国地区的具体差异

AWS::IoT::PolicyPrincipalAttachment

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

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

语法

JSON

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

YAML

Copy
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

Copy
{ "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

Copy
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"

本页内容: