Amazon Bedrock用に事前定義されているIAMポリシー
Amazon Bedrock用に事前定義されているIAMポリシーは幾つかあります。そのうち以下の3つを引用しておきます。
- AmazonBedrockFullAccess
- AmazonBedrockLimitedAccess
- AmazonBedrockReadOnly
AmazonBedrockFullAccess (バージョン3)¶
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "BedrockAll",
"Effect": "Allow",
"Action": ["bedrock:*"],
"Resource": "*"
},
{
"Sid": "DescribeKey",
"Effect": "Allow",
"Action": ["kms:DescribeKey"],
"Resource": "arn:*:kms:*:::*"
},
{
"Sid": "APIsWithAllResourceAccess",
"Effect": "Allow",
"Action": [
"iam:ListRoles",
"ec2:DescribeVpcs",
"ec2:DescribeSubnets",
"ec2:DescribeSecurityGroups"
],
"Resource": "*"
},
{
"Sid": "MarketplaceModelEndpointMutatingAPIs",
"Effect": "Allow",
"Action": [
"sagemaker:CreateEndpoint",
"sagemaker:CreateEndpointConfig",
"sagemaker:CreateModel",
"sagemaker:DeleteEndpoint",
"sagemaker:UpdateEndpoint"
],
"Resource": [
"arn:aws:sagemaker:*:*:endpoint/*",
"arn:aws:sagemaker:*:*:endpoint-config/*",
"arn:aws:sagemaker:*:*:model/*"
],
"Condition": {
"StringEquals": {
"aws:CalledViaLast": "bedrock.amazonaws.com",
"aws:ResourceTag/sagemaker-sdk:bedrock": "compatible"
}
}
},
{
"Sid": "MarketplaceModelEndpointAddTagsOperations",
"Effect": "Allow",
"Action": ["sagemaker:AddTags"],
"Resource": [
"arn:aws:sagemaker:*:*:endpoint/*",
"arn:aws:sagemaker:*:*:endpoint-config/*",
"arn:aws:sagemaker:*:*:model/*"
],
"Condition": {
"ForAllValues:StringEquals": {
"aws:TagKeys": [
"sagemaker-sdk:bedrock",
"bedrock:marketplace-registration-status",
"sagemaker-studio:hub-content-arn"
]
},
"StringLike": {
"aws:RequestTag/sagemaker-sdk:bedrock": "compatible",
"aws:RequestTag/bedrock:marketplace-registration-status": "registered",
"aws:RequestTag/sagemaker-studio:hub-content-arn": "arn:aws:sagemaker:*:aws:hub-content/SageMakerPublicHub/Model/*"
}
}
},
{
"Sid": "MarketplaceModelEndpointDeleteTagsOperations",
"Effect": "Allow",
"Action": ["sagemaker:DeleteTags"],
"Resource": [
"arn:aws:sagemaker:*:*:endpoint/*",
"arn:aws:sagemaker:*:*:endpoint-config/*",
"arn:aws:sagemaker:*:*:model/*"
],
"Condition": {
"ForAllValues:StringEquals": {
"aws:TagKeys": [
"sagemaker-sdk:bedrock",
"bedrock:marketplace-registration-status",
"sagemaker-studio:hub-content-arn"
]
},
"StringLike": {
"aws:ResourceTag/sagemaker-sdk:bedrock": "compatible",
"aws:ResourceTag/bedrock:marketplace-registration-status": "registered",
"aws:ResourceTag/sagemaker-studio:hub-content-arn": "arn:aws:sagemaker:*:aws:hub-content/SageMakerPublicHub/Model/*"
}
}
},
{
"Sid": "MarketplaceModelEndpointNonMutatingAPIs",
"Effect": "Allow",
"Action": [
"sagemaker:DescribeEndpoint",
"sagemaker:DescribeEndpointConfig",
"sagemaker:DescribeModel",
"sagemaker:DescribeInferenceComponent",
"sagemaker:ListEndpoints",
"sagemaker:ListTags"
],
"Resource": [
"arn:aws:sagemaker:*:*:endpoint/*",
"arn:aws:sagemaker:*:*:endpoint-config/*",
"arn:aws:sagemaker:*:*:model/*"
],
"Condition": {
"StringEquals": {
"aws:CalledViaLast": "bedrock.amazonaws.com"
}
}
},
{
"Sid": "MarketplaceModelEndpointInvokingOperations",
"Effect": "Allow",
"Action": [
"sagemaker:InvokeEndpoint",
"sagemaker:InvokeEndpointWithResponseStream"
],
"Resource": ["arn:aws:sagemaker:*:*:endpoint/*"],
"Condition": {
"StringEquals": {
"aws:CalledViaLast": "bedrock.amazonaws.com",
"aws:ResourceTag/sagemaker-sdk:bedrock": "compatible"
}
}
},
{
"Sid": "DiscoveringMarketplaceModel",
"Effect": "Allow",
"Action": ["sagemaker:DescribeHubContent"],
"Resource": [
"arn:aws:sagemaker:*:aws:hub-content/SageMakerPublicHub/Model/*",
"arn:aws:sagemaker:*:aws:hub/SageMakerPublicHub"
]
},
{
"Sid": "AllowMarketplaceModelsListing",
"Effect": "Allow",
"Action": ["sagemaker:ListHubContents"],
"Resource": "arn:aws:sagemaker:*:aws:hub/SageMakerPublicHub"
},
{
"Sid": "PassRoleToSageMaker",
"Effect": "Allow",
"Action": ["iam:PassRole"],
"Resource": ["arn:aws:iam::*:role/*SageMaker*ForBedrock*"],
"Condition": {
"StringEquals": {
"iam:PassedToService": [
"sagemaker.amazonaws.com",
"bedrock.amazonaws.com"
]
}
}
},
{
"Sid": "PassRoleToBedrock",
"Effect": "Allow",
"Action": ["iam:PassRole"],
"Resource": "arn:aws:iam::*:role/*AmazonBedrock*",
"Condition": {
"StringEquals": {
"iam:PassedToService": ["bedrock.amazonaws.com"]
}
}
},
{
"Sid": "MarketplaceOperationsFromBedrockFor3pModels",
"Effect": "Allow",
"Action": [
"aws-marketplace:Subscribe",
"aws-marketplace:ViewSubscriptions",
"aws-marketplace:Unsubscribe"
],
"Resource": "*",
"Condition": {
"StringEquals": {
"aws:CalledViaLast": "bedrock.amazonaws.com"
}
}
}
]
}
AmazonBedrockLimitedAccess (バージョン1)¶
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "BedrockAPIs",
"Effect": "Allow",
"Action": [
"bedrock:Get*",
"bedrock:List*",
"bedrock:CallWithBearerToken",
"bedrock:BatchDeleteEvaluationJob",
"bedrock:CreateEvaluationJob",
"bedrock:CreateGuardrail",
"bedrock:CreateGuardrailVersion",
"bedrock:CreateInferenceProfile",
"bedrock:CreateModelCopyJob",
"bedrock:CreateModelCustomizationJob",
"bedrock:CreateModelImportJob",
"bedrock:CreateModelInvocationJob",
"bedrock:CreatePromptRouter",
"bedrock:CreateProvisionedModelThroughput",
"bedrock:DeleteCustomModel",
"bedrock:DeleteGuardrail",
"bedrock:DeleteImportedModel",
"bedrock:DeleteInferenceProfile",
"bedrock:DeletePromptRouter",
"bedrock:DeleteProvisionedModelThroughput",
"bedrock:StopEvaluationJob",
"bedrock:StopModelCustomizationJob",
"bedrock:StopModelInvocationJob",
"bedrock:TagResource",
"bedrock:UntagResource",
"bedrock:UpdateGuardrail",
"bedrock:UpdateProvisionedModelThroughput",
"bedrock:ApplyGuardrail",
"bedrock:InvokeModel",
"bedrock:InvokeModelWithResponseStream"
],
"Resource": "*"
},
{
"Sid": "DescribeKey",
"Effect": "Allow",
"Action": ["kms:DescribeKey"],
"Resource": "arn:*:kms:*:::*"
},
{
"Sid": "APIsWithAllResourceAccess",
"Effect": "Allow",
"Action": [
"iam:ListRoles",
"ec2:DescribeVpcs",
"ec2:DescribeSubnets",
"ec2:DescribeSecurityGroups"
],
"Resource": "*"
},
{
"Sid": "MarketplaceOperationsFromBedrockFor3pModels",
"Effect": "Allow",
"Action": [
"aws-marketplace:Subscribe",
"aws-marketplace:ViewSubscriptions",
"aws-marketplace:Unsubscribe"
],
"Resource": "*",
"Condition": {
"StringEquals": {
"aws:CalledViaLast": "bedrock.amazonaws.com"
}
}
}
]
}
AmazonBedrockReadOnly (バージョン5)¶
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AmazonBedrockReadOnly",
"Effect": "Allow",
"Action": ["bedrock:Get*", "bedrock:List*"],
"Resource": "*"
},
{
"Sid": "MarketplaceModelEndpointNonMutatingAPIs",
"Effect": "Allow",
"Action": [
"sagemaker:DescribeEndpoint",
"sagemaker:DescribeEndpointConfig",
"sagemaker:DescribeModel",
"sagemaker:DescribeInferenceComponent",
"sagemaker:ListEndpoints",
"sagemaker:ListTags"
],
"Resource": [
"arn:aws:sagemaker:*:*:endpoint/*",
"arn:aws:sagemaker:*:*:endpoint-config/*",
"arn:aws:sagemaker:*:*:model/*"
],
"Condition": {
"StringEquals": {
"aws:CalledViaLast": "bedrock.amazonaws.com"
}
}
},
{
"Sid": "DiscoveringMarketplaceModel",
"Effect": "Allow",
"Action": ["sagemaker:DescribeHubContent"],
"Resource": [
"arn:aws:sagemaker:*:aws:hub-content/SageMakerPublicHub/Model/*",
"arn:aws:sagemaker:*:aws:hub/SageMakerPublicHub"
]
},
{
"Sid": "AllowMarketplaceModelsListing",
"Effect": "Allow",
"Action": ["sagemaker:ListHubContents"],
"Resource": "arn:aws:sagemaker:*:aws:hub/SageMakerPublicHub"
}
]
}