本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
在 Amazon Keyspaces CDC 直播中使用角色
Amazon Keyspaces(适用于 Apache Cassandra)使用 AWS Identity and Access Management (IAM) 服务相关角色。服务相关角色是一种独特类型的 IAM 角色,它与 Amazon Keyspaces 直接相关。服务相关角色由 Amazon Keyspaces 预定义,包括该服务代表您调用 AWS 其他服务所需的所有权限。
服务相关角色可让您更轻松地设置 Amazon Keyspaces,因为您不必手动添加必要的权限。Amazon Keyspaces 定义其服务相关角色的权限,除非另外定义,否则只有 Amazon Keyspaces 可以代入该角色。定义的权限包括信任策略和权限策略,而且权限策略不能附加到任何其它 IAM 实体。
您无法删除服务相关角色。
Amazon Keyspaces 的服务相关角色权限
Amazon Keyspaces 使用名为 AWSServiceRoleForAmazonKeyspacesCDC 的服务相关角色来允许 Amazon Keyspaces CDC 直播代表您向您的 CloudWatch 账户发布指标。
AWSServiceRoleForAmazonKeyspacesCDC 服务相关角色信任以下服务来代替该角色:
-
cassandra-streams.amazonaws.com
名为 Keyspaces 的角色权限策略允许 CDCService RolePolicy Amazon Keyspaces 对命名空间中的资源完成以下操作: CloudWatch AWS/Cassandra
-
操作:
*
上的cloudwatch:PutMetricData
AWSServiceRoleForAmazonKeyspacesCDC对符合以下条件的所有资源提供权限:操作:PutMetricData cloudwatch:
"cloudwatch:namespace": "AWS/Cassandra"
.
有关 Keyspaces 的更多信息 CDCServiceRolePolicy,请参阅。AWS 托管策略:Keyspaces CDCService RolePolicy
要为自动创建服务相关角色 CDC 的表启用 AWSService RoleForAmazonKeyspaces CDC 流,IAM 委托人需要以下权限。
{ "Sid": "KeyspacesCDCServiceLinkedRole", "Effect": "Allow", "Action": "iam:CreateServiceLinkedRole", "Resource": "arn:aws:iam::*:role/aws-service-role/cassandra-streams.amazonaws.com/AWSServiceRoleForAmazonKeyspacesCDC", "Condition": { "StringLike": { "iam:AWSServiceName": "cassandra-streams.amazonaws.com" } }
创建服务相关角色 AWSService RoleForAmazonKeyspaces CDC 的权限包含在AmazonKeyspacesFullAccess
托管策略中。有关更多信息,请参阅 AWS 托管策略: AmazonKeyspacesFullAccess。
为 Amazon Keyspaces 创建服务相关角色
您无需为 Amazon Keyspaces CDC 直播手动创建服务相关角色。当您使用 AWS Management Console、CQL、或 API 在表上启用 Amazon Keyspaces CDC 流时 AWS ,Amazon Keyspaces 会为您创建服务相关角色。 AWS CLI
如果您删除该服务相关角色,然后需要再次创建,您可以使用相同流程在账户中重新创建此角色。当您为表启用 Amazon Keyspaces CDC 流时,Amazon Keyspaces 会再次为您创建与服务相关的角色。
为 Amazon Keyspaces 编辑服务相关角色
Amazon Keyspaces 不允许您编辑 AWSService RoleForAmazonKeyspaces CDC 服务相关角色。创建服务相关角色后,您将无法更改角色的名称,因为可能有多种实体引用该角色。但是可以使用 IAM 编辑角色描述。有关更多信息,请参阅《IAM 用户指南》中的编辑服务相关角色。
Amazon Keyspaces 服务相关角色支持的区域
Amazon Keyspaces 支持在该服务可用的所有区域中使用服务相关角色。有关更多信息,请参阅 AWS 区域和端点。