Amazon Comprehend 的操作、资源和条件键 - 服务授权参考

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

Amazon Comprehend 的操作、资源和条件键

Amazon Comprehend(服务前缀:comprehend)提供以下服务特定的资源、操作和条件上下文键以在 IAM 权限策略中使用。

参考:

Amazon Comprehend 定义的操作

您可以在 IAM 策略语句的 Action 元素中指定以下操作。可以使用策略授予在 AWS中执行操作的权限。您在策略中使用一项操作时,通常使用相同的名称允许或拒绝对 API 操作或 CLI 命令的访问。但在某些情况下,单一动作可控制对多项操作的访问。还有某些操作需要多种不同的动作。

操作表的资源类型列指示每项操作是否支持资源级权限。如果该列没有任何值,您必须在策略语句的 Resource 元素中指定策略应用的所有资源(“*”)。通过在 IAM policy 中使用条件来筛选访问权限,以控制是否可以在资源或请求中使用特定标签键。如果操作具有一个或多个必需资源,则调用方必须具有使用这些资源来使用该操作的权限。必需资源在表中以星号 (*) 表示。如果您在 IAM policy 中使用 Resource 元素限制资源访问权限,则必须为每种必需的资源类型添加 ARN 或模式。某些操作支持多种资源类型。如果资源类型是可选的(未指示为必需),则可以选择使用一种可选资源类型。

操作表的条件键列包括可以在策略语句的 Condition 元素中指定的键。有关与服务资源关联的条件键的更多信息,请参阅资源类型表的条件键列。

注意

资源条件键在资源类型表中列出。您可以在操作表的资源类型(* 为必需)列中找到应用于某项操作的资源类型的链接。资源类型表中的资源类型包括条件密钥列,这是应用于操作表中操作的资源条件键。

有关下表中各列的详细信息,请参阅操作表

操作 描述 访问级别 资源类型(* 为必需) 条件键 相关操作
BatchDetectDominantLanguage 授予权限以检测文本文档列表中存在的一种或多种语言 Read
BatchDetectEntities 授予权限以在给定文本文档列表中检测指定的实体(“People”、“Places”、“Locations”等) Read
BatchDetectKeyPhrases 授予权限以在文本文档列表中检测最能指示内容的短语 Read
BatchDetectSentiment 授予权限以检测文档列表中的文本的感情色彩(Positive、Negative、Neutral 或 Mixed) Read
BatchDetectSyntax 授予权限以检测文本文档列表中语法信息(例如词性、标记) 读取
BatchDetectTargetedSentiment 授予权限以检测与给定文本文档列表中的特定实体(如品牌或产品)关联的情绪 读取
ClassifyDocument 授予权限以创建一个新的文档分类请求,以使用之前创建和训练的自定义模型和终端节点来实时分析单个文档 读取

document-classifier-endpoint*

ContainsPiiEntities 授予权限以对给定文档中的个人身份信息进行实时分类 读取
CreateDataset 授予权限以在飞轮中创建新的数据集 写入

flywheel*

aws:RequestTag/${TagKey}

aws:TagKeys

CreateDocumentClassifier 授予权限以创建可用于对文档进行分类的新文档分类器 Write

document-classifier*

aws:RequestTag/${TagKey}

aws:TagKeys

comprehend:VolumeKmsKey

comprehend:ModelKmsKey

comprehend:OutputKmsKey

comprehend:VpcSecurityGroupIds

comprehend:VpcSubnets

CreateEndpoint 授予权限以便为之前训练的自定义模型的同步推理创建模型特定的终端节点 Write

document-classifier*

document-classifier-endpoint*

aws:RequestTag/${TagKey}

aws:TagKeys

entity-recognizer*

entity-recognizer-endpoint*

aws:RequestTag/${TagKey}

aws:TagKeys

flywheel

CreateEntityRecognizer 授予权限以使用提交的文件创建实体识别器 写入

entity-recognizer*

aws:RequestTag/${TagKey}

aws:TagKeys

comprehend:VolumeKmsKey

comprehend:ModelKmsKey

comprehend:VpcSecurityGroupIds

comprehend:VpcSubnets

CreateFlywheel 授予权限以创建可用于训练模型版本的新飞轮 写入

flywheel*

aws:RequestTag/${TagKey}

aws:TagKeys

comprehend:VolumeKmsKey

comprehend:ModelKmsKey

comprehend:DataLakeKmsKey

comprehend:VpcSecurityGroupIds

comprehend:VpcSubnets

document-classifier

entity-recognizer

DeleteDocumentClassifier 授予权限以删除先前创建的文档分类器 Write

document-classifier*

DeleteEndpoint 授予权限以删除之前训练的自定义模型的模型特定的终端节点 必须删除所有终端节点才能删除模型 Write

document-classifier-endpoint*

entity-recognizer-endpoint*

DeleteEntityRecognizer 授予权限以删除已提交的实体识别器 写入

entity-recognizer*

DeleteFlywheel 授予权限以删除飞轮 写入

flywheel*

DeleteResourcePolicy 授予移除资源的策略的权限 写入

document-classifier*

entity-recognizer*

DescribeDataset 授予权限以获取与数据集关联的属性 读取

flywheel-dataset*

DescribeDocumentClassificationJob 授予权限以获取与文档分类作业关联的属性 Read

document-classification-job*

DescribeDocumentClassifier 授予权限以获取与文档分类器关联的属性 Read

document-classifier*

DescribeDominantLanguageDetectionJob 授予权限以获取与主导语言检测作业关联的属性 Read

dominant-language-detection-job*

DescribeEndpoint 授予权限以获取与特定终端节点关联的属性 使用此操作获取终端节点的状态 Read

document-classifier-endpoint*

entity-recognizer-endpoint*

DescribeEntitiesDetectionJob 授予权限以获取与实体检测作业关联的属性 Read

entities-detection-job*

DescribeEntityRecognizer 授予权限以提供有关实体识别器的详细信息,包括状态、包含训练数据的 S3 存储桶、识别器元数据、指标等 Read

entity-recognizer*

DescribeEventsDetectionJob 授予获取与事件检测作业关联的属性的权限 读取

events-detection-job*

DescribeFlywheel 授予权限以获取与飞轮关联的属性 读取

flywheel*

DescribeFlywheelIteration 授予权限以获取与飞轮的飞轮迭代关联的属性 读取

flywheel*

comprehend:FlywheelIterationId

DescribeKeyPhrasesDetectionJob 授予权限以获取与关键短语检测作业关联的属性 Read

key-phrases-detection-job*

DescribePiiEntitiesDetectionJob 授予权限以获取与 PII 实体检测作业关联的属性 读取

pii-entities-detection-job*

DescribeResourcePolicy 授予读取附加的资源策略的权限 读取

document-classifier*

entity-recognizer*

DescribeSentimentDetectionJob 授予权限以获取与情绪检测作业关联的属性 读取

sentiment-detection-job*

DescribeTargetedSentimentDetectionJob 授予权限以获取与目标情绪检测任务关联的属性 读取

targeted-sentiment-detection-job*

DescribeTopicsDetectionJob 授予权限以获取与主题检测作业关联的属性 Read

topics-detection-job*

DetectDominantLanguage 授予权限以检测文本中存在的一种或多种语言 Read
DetectEntities 授予权限以在给定文本文档中检测指定的实体(“People”、“Places”、“Locations”等) Read

entity-recognizer-endpoint

DetectKeyPhrases 授予权限以在文本中检测最能指示内容的短语 Read
DetectPiiEntities 授予权限以在给定文本文档中检测个人身份信息实体(“Name”、“SSN”、“PIN”等) Read
DetectSentiment 授予权限以检测文档中文本的感情色彩(Positive、Negative、Neutral 或 Mixed) Read
DetectSyntax 授予权限以检测文本文档中语法信息(例如词性、标记) 读取
DetectTargetedSentiment 授予权限以检测与文档中特定实体(例如品牌或产品)关联的情绪 读取
DetectToxicContent 授予检测给定文本段列表中有毒内容的权限 读取
ImportModel 授予导入经训练的 Comprehend 模型的权限 写入

document-classifier*

entity-recognizer*

aws:RequestTag/${TagKey}

aws:TagKeys

comprehend:ModelKmsKey

ListDatasets 授予权限以获取与飞轮关联的数据集列表 读取

flywheel*

ListDocumentClassificationJobs 授予权限以获取提交的文档分类作业列表 读取
ListDocumentClassifierSummaries 授予权限以获取已创建的文档分类器摘要的列表 读取
ListDocumentClassifiers 授予权限以获取已创建的文档分类器列表 读取
ListDominantLanguageDetectionJobs 授予权限以获取提交的主导语言检测作业列表 读取
ListEndpoints 授予权限以获取已创建的所有现有终端节点的列表 读取
ListEntitiesDetectionJobs 授予权限以获取提交的实体检测作业列表 读取
ListEntityRecognizerSummaries 授予权限以获取已创建的实体识别程序摘要的列表 读取
ListEntityRecognizers 授予权限以获取创建的所有实体识别器的属性列表,包括当前训练的识别器 读取
ListEventsDetectionJobs 授予权限以获取已提交的事件检测任务列表 读取
ListFlywheelIterationHistory 授予权限以获取与飞轮关联的迭代列表 读取

flywheel*

ListFlywheels 授予权限以获取已创建的飞轮列表 读取
ListKeyPhrasesDetectionJobs 授予权限以获取提交的关键短语检测作业列表 读取
ListPiiEntitiesDetectionJobs 授予权限以获取已提交的 PII 实体检测作业列表 读取
ListSentimentDetectionJobs 授予权限以获取已提交的情绪检测作业列表 读取
ListTagsForResource 授予权限以列出资源的标签 读取

document-classification-job

document-classifier

document-classifier-endpoint

dominant-language-detection-job

entities-detection-job

entity-recognizer

entity-recognizer-endpoint

events-detection-job

flywheel

flywheel-dataset

key-phrases-detection-job

pii-entities-detection-job

sentiment-detection-job

targeted-sentiment-detection-job

topics-detection-job

ListTargetedSentimentDetectionJobs 授予权限以获取已提交的目标情绪检测任务列表 读取
ListTopicsDetectionJobs 授予权限以获取已提交的主题检测作业列表 读取
PutResourcePolicy 授予将策略附加到资源的权限 写入

document-classifier*

entity-recognizer*

StartDocumentClassificationJob 授予权限以启动异步文档分类作业 Write

document-classification-job*

aws:RequestTag/${TagKey}

aws:TagKeys

comprehend:VolumeKmsKey

comprehend:OutputKmsKey

comprehend:VpcSecurityGroupIds

comprehend:VpcSubnets

document-classifier

flywheel

StartDominantLanguageDetectionJob 授予权限以便为一组文档启动异步主导语言检测作业 Write

dominant-language-detection-job*

aws:RequestTag/${TagKey}

aws:TagKeys

comprehend:VolumeKmsKey

comprehend:OutputKmsKey

comprehend:VpcSecurityGroupIds

comprehend:VpcSubnets

StartEntitiesDetectionJob 授予权限以便为一组文档启动异步实体检测作业 Write

entities-detection-job*

aws:RequestTag/${TagKey}

aws:TagKeys

comprehend:VolumeKmsKey

comprehend:OutputKmsKey

comprehend:VpcSecurityGroupIds

comprehend:VpcSubnets

entity-recognizer

flywheel

StartEventsDetectionJob 授予为一组文档启动异步事件检测作业的权限 写入

events-detection-job*

aws:RequestTag/${TagKey}

aws:TagKeys

comprehend:OutputKmsKey

StartFlywheelIteration 授予权限以启动飞轮的飞轮迭代 写入

flywheel*

StartKeyPhrasesDetectionJob 授予权限以便为一组文档启动异步关键短语检测作业 Write

key-phrases-detection-job*

aws:RequestTag/${TagKey}

aws:TagKeys

comprehend:VolumeKmsKey

comprehend:OutputKmsKey

comprehend:VpcSecurityGroupIds

comprehend:VpcSubnets

StartPiiEntitiesDetectionJob 授予权限以便为一组文档启动异步 PII 实体检测作业 Write

pii-entities-detection-job*

aws:RequestTag/${TagKey}

aws:TagKeys

comprehend:OutputKmsKey

StartSentimentDetectionJob 授予权限以便为一组文档启动异步情感检测作业 写入

sentiment-detection-job*

aws:RequestTag/${TagKey}

aws:TagKeys

comprehend:VolumeKmsKey

comprehend:OutputKmsKey

comprehend:VpcSecurityGroupIds

comprehend:VpcSubnets

StartTargetedSentimentDetectionJob 授予权限以便为一组文档启动异步目标情感检测任务 写入

targeted-sentiment-detection-job*

aws:RequestTag/${TagKey}

aws:TagKeys

comprehend:VolumeKmsKey

comprehend:OutputKmsKey

comprehend:VpcSecurityGroupIds

comprehend:VpcSubnets

StartTopicsDetectionJob 授予权限以启动异步任务来检测文档集合中最常见的主题以及与每个主题关联的短语 Write

topics-detection-job*

aws:RequestTag/${TagKey}

aws:TagKeys

comprehend:VolumeKmsKey

comprehend:OutputKmsKey

comprehend:VpcSecurityGroupIds

comprehend:VpcSubnets

StopDominantLanguageDetectionJob 授予权限以停止主导语言检测作业 Write

dominant-language-detection-job*

StopEntitiesDetectionJob 授予权限以停止实体检测作业 Write

entities-detection-job*

StopEventsDetectionJob 授予停止事件检测作业的权限 Write

events-detection-job*

StopKeyPhrasesDetectionJob 授予权限以停止关键短语检测作业 Write

key-phrases-detection-job*

StopPiiEntitiesDetectionJob 授予权限以停止 PII 实体检测作业 Write

pii-entities-detection-job*

StopSentimentDetectionJob 授予权限以停止情绪检测作业 写入

sentiment-detection-job*

StopTargetedSentimentDetectionJob 授予权限以停止目标情绪检测任务 写入

targeted-sentiment-detection-job*

StopTrainingDocumentClassifier 授予权限以停止先前创建的文档分类器训练作业 Write

document-classifier*

StopTrainingEntityRecognizer 授予权限以停止先前创建的实体识别器训练作业 Write

entity-recognizer*

TagResource 授予权限以使用给定的键值对标记资源 Tagging

document-classification-job

document-classifier

document-classifier-endpoint

dominant-language-detection-job

entities-detection-job

entity-recognizer

entity-recognizer-endpoint

events-detection-job

flywheel

flywheel-dataset

key-phrases-detection-job

pii-entities-detection-job

sentiment-detection-job

targeted-sentiment-detection-job

topics-detection-job

aws:RequestTag/${TagKey}

aws:TagKeys

UntagResource 授予权限以取消标记具有给定键的资源 Tagging

document-classification-job

document-classifier

document-classifier-endpoint

dominant-language-detection-job

entities-detection-job

entity-recognizer

entity-recognizer-endpoint

events-detection-job

flywheel

flywheel-dataset

key-phrases-detection-job

pii-entities-detection-job

sentiment-detection-job

targeted-sentiment-detection-job

topics-detection-job

aws:TagKeys

UpdateEndpoint 授予权限以更新有关指定终端节点的信息 写入

document-classifier-endpoint*

entity-recognizer-endpoint*

flywheel

UpdateFlywheel 授予权限以更新飞轮的配置 写入

flywheel*

comprehend:VolumeKmsKey

comprehend:ModelKmsKey

comprehend:VpcSecurityGroupIds

comprehend:VpcSubnets

document-classifier

entity-recognizer

Amazon Comprehend 定义的资源类型

以下资源类型是由该服务定义的,可以在 IAM 权限策略语句的 Resource 元素中使用这些资源类型。操作表中的每个操作指定了可以使用该操作指定的资源类型。您也可以在策略中包含条件键,从而定义资源类型。这些键显示在资源类型表的最后一列。有关下表中各列的详细信息,请参阅资源类型表

资源类型 ARN 条件键
targeted-sentiment-detection-job arn:${Partition}:comprehend:${Region}:${Account}:targeted-sentiment-detection-job/${JobId}

aws:ResourceTag/${TagKey}

document-classifier arn:${Partition}:comprehend:${Region}:${Account}:document-classifier/${DocumentClassifierName}

aws:ResourceTag/${TagKey}

document-classifier-endpoint arn:${Partition}:comprehend:${Region}:${Account}:document-classifier-endpoint/${DocumentClassifierEndpointName}

aws:ResourceTag/${TagKey}

entity-recognizer arn:${Partition}:comprehend:${Region}:${Account}:entity-recognizer/${EntityRecognizerName}

aws:ResourceTag/${TagKey}

entity-recognizer-endpoint arn:${Partition}:comprehend:${Region}:${Account}:entity-recognizer-endpoint/${EntityRecognizerEndpointName}

aws:ResourceTag/${TagKey}

dominant-language-detection-job arn:${Partition}:comprehend:${Region}:${Account}:dominant-language-detection-job/${JobId}

aws:ResourceTag/${TagKey}

entities-detection-job arn:${Partition}:comprehend:${Region}:${Account}:entities-detection-job/${JobId}

aws:ResourceTag/${TagKey}

pii-entities-detection-job arn:${Partition}:comprehend:${Region}:${Account}:pii-entities-detection-job/${JobId}

aws:ResourceTag/${TagKey}

events-detection-job arn:${Partition}:comprehend:${Region}:${Account}:events-detection-job/${JobId}

aws:ResourceTag/${TagKey}

key-phrases-detection-job arn:${Partition}:comprehend:${Region}:${Account}:key-phrases-detection-job/${JobId}

aws:ResourceTag/${TagKey}

sentiment-detection-job arn:${Partition}:comprehend:${Region}:${Account}:sentiment-detection-job/${JobId}

aws:ResourceTag/${TagKey}

topics-detection-job arn:${Partition}:comprehend:${Region}:${Account}:topics-detection-job/${JobId}

aws:ResourceTag/${TagKey}

document-classification-job arn:${Partition}:comprehend:${Region}:${Account}:document-classification-job/${JobId}

aws:ResourceTag/${TagKey}

flywheel arn:${Partition}:comprehend:${Region}:${Account}:flywheel/${FlywheelName}

aws:ResourceTag/${TagKey}

flywheel-dataset arn:${Partition}:comprehend:${Region}:${Account}:flywheel/${FlywheelName}/dataset/${DatasetName}

aws:ResourceTag/${TagKey}

Amazon Comprehend 的条件键

Amazon Comprehend 定义以下可以在 IAM policy 的 Condition 元素中使用的条件键。您可以使用这些键进一步细化应用策略语句的条件。有关下表中各列的详细信息,请参阅条件键表

要查看适用于所有服务的全局条件键,请参阅可用的全局条件键

条件键 描述 类型
aws:RequestTag/${TagKey} 通过要求资源创建请求中存在标签值来筛选访问权限 String
aws:ResourceTag/${TagKey} 通过要求提供与资源关联的标签值筛选访问权限 String
aws:TagKeys 通过要求请求中必需具有强制性标签来筛选访问权限 ArrayOfString
comprehend:DataLakeKmsKey 按请求中与飞轮资源关联的 DataLake Kms 密钥筛选访问权限 ARN
comprehend:FlywheelIterationId 按飞轮的特定迭代 ID 筛选访问 String
comprehend:ModelKmsKey 按与请求中的资源关联的模型 KMS 密钥筛选访问 ARN
comprehend:OutputKmsKey 按与请求中的资源关联的输出 KMS 密钥筛选访问 ARN
comprehend:VolumeKmsKey 按与请求中的资源关联的卷 KMS 密钥筛选访问 ARN
comprehend:VpcSecurityGroupIds 按与请求中的资源关联的所有 VPC 安全组 ID 的列表筛选访问 ArrayOfString
comprehend:VpcSubnets 按与请求中的资源关联的所有 VPC 子网的列表筛选访问 ArrayOfString