AWS::EventSchemas::RegistryPolicy - AWS CloudFormation
AWS 文档中描述的 AWS 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 AWS 服务入门

AWS::EventSchemas::RegistryPolicy

使用 AWS::EventSchemas::RegistryPolicy 资源为 EventBridge 架构注册表指定基于资源的策略。

语法

要在 AWS CloudFormation 模板中声明此实体,请使用以下语法:

JSON

{ "Type" : "AWS::EventSchemas::RegistryPolicy", "Properties" : { "Policy" : Json, "RegistryName" : String, "RevisionId" : String } }

YAML

Type: AWS::EventSchemas::RegistryPolicy Properties: Policy: Json RegistryName: String RevisionId: String

属性

Policy

基于资源的策略。

必需:是

类型:Json

Update requires: No interruption

RegistryName

注册表的名称。

必需:是

类型:字符串

Update requires: No interruption

RevisionId

策略的修订 ID。

必需:否

类型:字符串

Update requires: No interruption

返回值

Ref

当向 Ref 内部函数提供此资源的逻辑 ID 时,Ref 将返回注册表的名称。

Fn::GetAtt

Fn::GetAtt 内部函数返回此类型的一个指定属性的值。以下为可用属性和示例返回值。

有关使用 Fn::GetAtt 内部函数的更多信息,请参阅 Fn::GetAtt

Id

策略的 ID。

示例

YAML

Resources: RegistryPolicy: Type: AWS::EventSchemas::RegistryPolicy Properties: RegistryName: registryName Policy: Version: 2012-10-17 Statement: Sid: 1 Effect: Allow Principal: AWS: arn:aws:iam::012345678901:user/TestAccountForRegistryPolicy Action: - schemas:DescribeRegistry - schemas:CreateSchema Resource: registryArn

YAML

Resources: RegistryPolicy: Type: 'AWS::EventSchemas::RegistryPolicy' Properties: RegistryName: 'MyRegistry' Policy: Version: '2012-10-17' Statement: - Sid: 'Test' Effect: 'Allow' Action: - 'schemas:*' Principal: AWS: - '109876543210' Resource: - 'arn:aws:schemas:us-east-1:012345678901:registry/MyRegistry' - 'arn:aws:schemas:us-east-1:012345678901:schema/MyRegistry*'

JSON

{ "Resources": { "RegistryPolicy": { "Type": "AWS::EventSchemas::RegistryPolicy", "Properties": { "RegistryName": "MyRegistry", "Policy": { "Version": "2012-10-17", "Statement": [ { "Sid": "Test", "Effect": "Allow", "Action": [ "schemas:*" ], "Principal": { "AWS": [ "109876543210" ] }, "Resource": [ "arn:aws:schemas:us-east-1:012345678901:registry/MyRegistry", "arn:aws:schemas:us-east-1:012345678901:schema/MyRegistry*" ] } ] } } } } }