SageMakerStudioBedrockKnowledgeBaseServiceRolePolicy

Last Modified

Mar 12, 2026

March 12, 2026 at 09:29 PM UTC

Version

v9

Total Versions

3

Created

Feb 12, 2026

Actions

31

Risk

no risk signal

Read from this policy document alone: trust policies, boundaries and SCPs in your account still decide what actually succeeds. How this is assessed

IAM Access Analyzer (1)

  • Warning / TYPE_MISMATCH

    Use the operator type String instead of operator ARN for the condition key kms:EncryptionContext:aws:s3:arn. AWS docs

Policy Document

View on GitHub
{
  "PolicyVersion": {
    "Document": {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "BedrockAppInferenceProfileInvocationPermissions",
          "Effect": "Allow",
          "Action": [
            "bedrock:GetInferenceProfile",
            "bedrock:InvokeModel",
            "bedrock:InvokeModelWithResponseStream"
          ],
          "Resource": "arn:aws:bedrock:*:*:application-inference-profile/*",
          "Condition": {
            "StringEquals": {
              "aws:ResourceTag/AmazonDataZoneProject": "${aws:PrincipalTag/AmazonDataZoneProject}"
            }
          }
        },
        {
          "Sid": "BedrockModelInvocationPermission",
          "Effect": "Allow",
          "Action": [
            "bedrock:InvokeModel",
            "bedrock:InvokeModelWithResponseStream"
          ],
          "Resource": [
            "arn:aws:bedrock:*::foundation-model/*",
            "arn:aws:bedrock:*:*:custom-model/*",
            "arn:aws:bedrock:*:*:provisioned-model/*"
          ],
          "Condition": {
            "Null": {
              "bedrock:InferenceProfileArn": "false"
            }
          }
        },
        {
          "Sid": "OpenSearchServerlessPermissions",
          "Effect": "Allow",
          "Action": "aoss:APIAccessAll",
          "Resource": "arn:aws:aoss:*:*:collection/*",
          "Condition": {
            "StringEquals": {
              "aws:ResourceAccount": "${aws:PrincipalAccount}"
            },
            "StringLike": {
              "aoss:collection": "bedrock*"
            }
          }
        },
        {
          "Sid": "ListDomainS3BucketPermissions",
          "Effect": "Allow",
          "Action": "s3:ListBucket",
          "Resource": "arn:aws:s3:::${aws:PrincipalTag/DomainBucketName}",
          "Condition": {
            "StringEquals": {
              "aws:ResourceAccount": "${aws:PrincipalAccount}"
            },
            "StringLike": {
              "s3:prefix": [
                "${aws:PrincipalTag/AmazonDataZoneDomain}/${aws:PrincipalTag/AmazonDataZoneProject}",
                "${aws:PrincipalTag/AmazonDataZoneDomain}/${aws:PrincipalTag/AmazonDataZoneProject}/*"
              ]
            },
            "StringNotEquals": {
              "aws:PrincipalTag/DomainBucketName": "",
              "aws:PrincipalTag/AmazonDataZoneDomain": "",
              "aws:PrincipalTag/AmazonDataZoneProject": ""
            }
          }
        },
        {
          "Sid": "AccessDomainS3BucketPermissions",
          "Effect": "Allow",
          "Action": [
            "s3:GetObject",
            "s3:GetObjectVersion"
          ],
          "Resource": "arn:aws:s3:::${aws:PrincipalTag/DomainBucketName}/${aws:PrincipalTag/AmazonDataZoneDomain}/${aws:PrincipalTag/AmazonDataZoneProject}/*",
          "Condition": {
            "StringEquals": {
              "aws:ResourceAccount": "${aws:PrincipalAccount}"
            },
            "StringNotEquals": {
              "aws:PrincipalTag/DomainBucketName": "",
              "aws:PrincipalTag/AmazonDataZoneDomain": "",
              "aws:PrincipalTag/AmazonDataZoneProject": ""
            }
          }
        },
        {
          "Sid": "VectorStoresKms",
          "Effect": "Allow",
          "Action": [
            "kms:Decrypt",
            "kms:GenerateDataKey"
          ],
          "Resource": "arn:aws:kms:*:*:key/${aws:PrincipalTag/KmsKeyId}",
          "Condition": {
            "StringLike": {
              "kms:ViaService": [
                "neptune-graph.*.amazonaws.com",
                "s3vectors.*.amazonaws.com"
              ]
            },
            "StringEquals": {
              "aws:ResourceAccount": "${aws:PrincipalAccount}"
            },
            "Null": {
              "kms:EncryptionContextKeys": "false"
            }
          }
        },
        {
          "Sid": "VectorStoresKmsDescribeKey",
          "Effect": "Allow",
          "Action": [
            "kms:DescribeKey"
          ],
          "Resource": "arn:aws:kms:*:*:key/${aws:PrincipalTag/KmsKeyId}",
          "Condition": {
            "StringLike": {
              "kms:ViaService": [
                "neptune-graph.*.amazonaws.com",
                "s3vectors.*.amazonaws.com"
              ]
            },
            "StringEquals": {
              "aws:ResourceAccount": "${aws:PrincipalAccount}"
            }
          }
        },
        {
          "Sid": "NeptuneGraphDataAccess",
          "Effect": "Allow",
          "Action": [
            "neptune-graph:GetGraph",
            "neptune-graph:DeleteDataViaQuery",
            "neptune-graph:WriteDataViaQuery",
            "neptune-graph:ReadDataViaQuery"
          ],
          "Resource": "arn:aws:neptune-graph:*:*:graph/*",
          "Condition": {
            "StringEquals": {
              "aws:ResourceAccount": "${aws:PrincipalAccount}",
              "aws:ResourceTag/AmazonDataZoneProject": "${aws:PrincipalTag/AmazonDataZoneProject}"
            }
          }
        },
        {
          "Sid": "S3VectorsDataAccess",
          "Effect": "Allow",
          "Action": [
            "s3vectors:GetVectorBucket",
            "s3vectors:GetIndex",
            "s3vectors:PutVectors",
            "s3vectors:GetVectors",
            "s3vectors:ListVectors",
            "s3vectors:QueryVectors",
            "s3vectors:DeleteVectors"
          ],
          "Resource": "arn:aws:s3vectors:*:*:bucket/amazon-bedrock-ide-${aws:PrincipalTag/AmazonDataZoneProject}*",
          "Condition": {
            "StringNotEquals": {
              "aws:PrincipalTag/AmazonDataZoneProject": ""
            },
            "StringEquals": {
              "aws:ResourceAccount": "${aws:PrincipalAccount}"
            }
          }
        },
        {
          "Sid": "BedrockKnowledgeBaseKmsPermissions",
          "Effect": "Allow",
          "Action": [
            "kms:Decrypt",
            "kms:GenerateDataKey"
          ],
          "Resource": "arn:aws:kms:*:*:key/${aws:PrincipalTag/KmsKeyId}",
          "Condition": {
            "StringEquals": {
              "aws:ResourceAccount": "${aws:PrincipalAccount}"
            },
            "StringLike": {
              "kms:EncryptionContext:aws:bedrock:arn": "arn:aws:bedrock:*:${aws:PrincipalAccount}:knowledge-base/*"
            }
          }
        },
        {
          "Sid": "S3KmsPermissions",
          "Effect": "Allow",
          "Action": "kms:Decrypt",
          "Resource": "arn:aws:kms:*:*:key/${aws:PrincipalTag/KmsKeyId}",
          "Condition": {
            "StringLike": {
              "kms:ViaService": "s3.*.amazonaws.com"
            },
            "StringEquals": {
              "aws:ResourceAccount": "${aws:PrincipalAccount}"
            },
            "ArnLike": {
              "kms:EncryptionContext:aws:s3:arn": [
                "arn:aws:s3:::${aws:PrincipalTag/DomainBucketName}",
                "arn:aws:s3:::${aws:PrincipalTag/DomainBucketName}/*"
              ]
            }
          }
        },
        {
          "Sid": "SqlWorkbenchAccessPermissions",
          "Effect": "Allow",
          "Action": [
            "sqlworkbench:GetSqlRecommendations",
            "sqlworkbench:PutSqlGenerationContext",
            "sqlworkbench:GetSqlGenerationContext",
            "sqlworkbench:DeleteSqlGenerationContext"
          ],
          "Resource": "*"
        },
        {
          "Sid": "BedrockGenerateQueryPermissions",
          "Effect": "Allow",
          "Action": [
            "bedrock:GenerateQuery"
          ],
          "Resource": "*"
        }
      ]
    },
    "VersionId": "v9",
    "IsDefaultVersion": true,
    "CreateDate": "2026-02-12T18:00:27+00:00"
  }
}

Version History (6 recorded)

Raw history
v9updated

scope changed, no action added or removed

cd7b4d4

SageMakerStudioBedrockKnowledgeBaseServiceRolePolicy - Policy Version v9

No recorded action delta - this version predates the change index. View the raw diff.

Feb 12, 2026

5f39589

SageMakerStudioBedrockKnowledgeBaseServiceRolePolicy - Policy Version v6

No recorded action delta - this version predates the change index. View the raw diff.

Feb 12, 2026

533e8bc

SageMakerStudioBedrockKnowledgeBaseServiceRolePolicy - Policy Version v3

No recorded action delta - this version predates the change index. View the raw diff.

Jul 15, 2025

649c88d

Update detected

No recorded action delta - this version predates the change index. View the raw diff.

Apr 16, 2025

8949dbb

Update detected

No recorded action delta - this version predates the change index. View the raw diff.

Feb 25, 2025

b63399f