使用 Amazon Bedrock 控制台创建模型评估作业所需的权限 - Amazon Bedrock

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

使用 Amazon Bedrock 控制台创建模型评估作业所需的权限

使用 Amazon Bedrock 控制台创建模型评估任务时,必须在 Amazon S3 存储桶中指定正确的CORS权限。要了解更多信息,请参阅 S3 存储桶所需的跨源资源共享 (CORS) 权限

对于自动模型评估作业或使用人工的模型评估作业,创建模型评估作业所需的IAM权限是不同的。

自动和基于人工的模型评估作业都需要访问 Amazon S3 和 Amazon Bedrock。要创建基于人工的模型评估任务,您需要获得 Amazon Cognito 和 Amazon 的额外权限。 SageMaker

要详细了解创建自动模型评估作业和基于人工的模型评估作业所需的服务角色,请参阅 模型评估作业的服务角色要求

创建自动模型评估任务所需的控制台权限

以下策略包含 Amazon Bedrock 和 Amazon S3 中使用 Amazon Bedrock 控制台创建自动模型评估任务所需的最低限度IAM操作和资源集。

{ "Version": "2012-10-17", "Statement": [ { "Sid": "BedrockConsole", "Effect": "Allow", "Action": [ "bedrock:CreateEvaluationJob", "bedrock:GetEvaluationJob", "bedrock:ListEvaluationJobs", "bedrock:StopEvaluationJob", "bedrock:GetCustomModel", "bedrock:ListCustomModels", "bedrock:CreateProvisionedModelThroughput", "bedrock:UpdateProvisionedModelThroughput", "bedrock:GetProvisionedModelThroughput", "bedrock:ListProvisionedModelThroughputs", "bedrock:ListTagsForResource", "bedrock:UntagResource", "bedrock:TagResource" ], "Resource": "*" }, { "Sid": "AllowConsoleS3AccessForModelEvaluation", "Effect": "Allow", "Action": [ "s3:GetObject", "s3:GetBucketCORS", "s3:ListBucket", "s3:ListBucketVersions", "s3:GetBucketLocation" ], "Resource": "*" } ] }

创建基于人类的模型评估作业所需的控制台权限

要通过 Amazon Bedrock 控制台创建使用人工的模型评估作业,您需要为用户、群组或角色添加额外的权限。

以下政策包含 Amazon Cognito 和 Amazon 创建基于人 SageMaker 为的模型评估任务所需的最低限度IAM操作和资源。您必须将此策略附加到自动模型评估任务的基本策略要求中。

{ "Version": "2012-10-17", "Statement": [ { "Sid": "AllowCognitionActionsForWorkTeamCreations", "Effect": "Allow", "Action": [ "cognito-idp:CreateUserPool", "cognito-idp:CreateUserPoolClient", "cognito-idp:CreateGroup", "cognito-idp:AdminCreateUser", "cognito-idp:AdminAddUserToGroup", "cognito-idp:CreateUserPoolDomain", "cognito-idp:UpdateUserPool", "cognito-idp:ListUsersInGroup", "cognito-idp:ListUsers", "cognito-idp:AdminRemoveUserFromGroup" ], "Resource": "*" }, { "Sid": "AllowSageMakerResourceCreation", "Effect": "Allow", "Action": [ "sagemaker:CreateFlowDefinition", "sagemaker:CreateWorkforce", "sagemaker:CreateWorkteam", "sagemaker:DescribeFlowDefinition", "sagemaker:DescribeHumanLoop", "sagemaker:ListFlowDefinitions", "sagemaker:ListHumanLoops", "sagemaker:DescribeWorkforce", "sagemaker:DescribeWorkteam", "sagemaker:ListWorkteams", "sagemaker:ListWorkforces", "sagemaker:DeleteFlowDefinition", "sagemaker:DeleteHumanLoop", "sagemaker:RenderUiTemplate", "sagemaker:StartHumanLoop", "sagemaker:StopHumanLoop" ], "Resource": "*" } ] }

S3 存储桶所需的跨源资源共享 (CORS) 权限

创建使用 Amazon Bedrock 控制台的模型评估任务时,必须在 S3 存储桶上指定CORS配置。

CORS配置是定义规则的文档,用于识别您将允许访问存储桶的来源、每个源支持的操作(HTTP方法)以及其他特定于操作的信息。要了解有关使用 S3 控制台设置所需CORS配置的更多信息,请参阅 A mazon S3 用户指南中的配置跨源资源共享 (CORS)

以下是 S3 存储桶所需的最低CORS配置。

[{ "AllowedHeaders": [ "*" ], "AllowedMethods": [ "GET", "PUT", "POST", "DELETE" ], "AllowedOrigins": [ "*" ], "ExposeHeaders": ["Access-Control-Allow-Origin"] }]