Skip to main content
IAM Policy Map

SageMakerStudioBedrockKnowledgeBaseServiceRolePolicy

OperatorService roleActivePermissions reviewedShow on mapCompare

Summary

Allows Amazon Bedrock Knowledge Bases to access Amazon Bedrock models and data sources in SageMaker Studio.

Permissions imported from the AWS Managed Policy Reference Guide; other sections pending editorial review.

Identity

ARN
arn:aws:iam::aws:policy/service-role/SageMakerStudioBedrockKnowledgeBaseServiceRolePolicy
Default version
v9
Created
Last edited
Services
aoss, bedrock, kms, neptune-graph, s3, s3vectors, sqlworkbench

Control-plane actions (21)

By access level: 1 List, 11 Read, 9 Write.

Control-plane actions by service
ServiceGrantedAccess levels and limitsGranted by
OpenSearch Serverless1 of 571 Write; 1 restricted, 1 conditionalaoss:APIAccessAll
Bedrock2 of 2322 Read; 2 restricted, 2 conditionalbedrock:GetInferenceProfile, bedrock:InvokeModelWithResponseStream
KMS3 of 581 Read, 2 Write; 3 restricted, 3 conditionalkms:Decrypt, kms:DescribeKey, kms:GenerateDataKey
Neptune Analytics4 of 382 Read, 2 Write; 4 restricted, 4 conditionalneptune-graph:DeleteDataViaQuery, neptune-graph:GetGraph, neptune-graph:ReadDataViaQuery, neptune-graph:WriteDataViaQuery
S3 Vectors7 of 211 List, 4 Read, 2 Write; 7 restricted, 7 conditionals3vectors:DeleteVectors, s3vectors:GetIndex, s3vectors:GetVectorBucket, s3vectors:GetVectors, s3vectors:ListVectors, s3vectors:PutVectors, s3vectors:QueryVectors
SQL Workbench4 of 792 Read, 2 Write; 0 restricted, 0 conditionalsqlworkbench:DeleteSqlGenerationContext, sqlworkbench:GetSqlGenerationContext, sqlworkbench:GetSqlRecommendations, sqlworkbench:PutSqlGenerationContext
OpenSearch Serverless: 1 actions
  • aoss:APIAccessAll (Write)
Bedrock: 2 actions
  • bedrock:GetInferenceProfile (Read)
  • bedrock:InvokeModelWithResponseStream (Read)
KMS: 3 actions
  • kms:Decrypt (Write)
  • kms:DescribeKey (Read)
  • kms:GenerateDataKey (Write)
Neptune Analytics: 4 actions
  • neptune-graph:DeleteDataViaQuery (Write)
  • neptune-graph:GetGraph (Read)
  • neptune-graph:ReadDataViaQuery (Read)
  • neptune-graph:WriteDataViaQuery (Write)
S3 Vectors: 7 actions
  • s3vectors:DeleteVectors (Write)
  • s3vectors:GetIndex (Read)
  • s3vectors:GetVectorBucket (Read)
  • s3vectors:GetVectors (Read)
  • s3vectors:ListVectors (List)
  • s3vectors:PutVectors (Write)
  • s3vectors:QueryVectors (Read)
SQL Workbench: 4 actions
  • sqlworkbench:DeleteSqlGenerationContext (Write)
  • sqlworkbench:GetSqlGenerationContext (Read)
  • sqlworkbench:GetSqlRecommendations (Read)
  • sqlworkbench:PutSqlGenerationContext (Write)

Data-plane actions (5)

By access level: 1 List, 4 Read.

Data-plane actions by service
ServiceGrantedAccess levels and limitsGranted by
Bedrock2 of 372 Read; 1 restricted, 1 conditionalbedrock:GenerateQuery, bedrock:InvokeModel
S33 of 251 List, 2 Read; 3 restricted, 3 conditionals3:GetObject, s3:GetObjectVersion, s3:ListBucket
Bedrock: 2 actions
  • bedrock:GenerateQuery (Read)
  • bedrock:InvokeModel (Read)
S3: 3 actions
  • s3:GetObject (Read)
  • s3:GetObjectVersion (Read)
  • s3:ListBucket (List)

Excluded and conditional actions

No patterns are excluded by NotAction or Deny statements.

Resource scope and attachment

Resource scope across granted actions: mixed.

Can be attached: Yes, to users, groups and roles.

Why this tier

  • Grants 9 write, tagging or permissions-management actions, short of full control of any service.

Guidance

Pending editorial review. The permission data on this page comes straight from AWS; this section will be filled in once a reviewed guide exists.

Same service

Same domain

Frequently asked questions

Pending editorial review. The permission data on this page comes straight from AWS; this section will be filled in once a reviewed guide exists.

Policy JSON

Download policy.json

{
  "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": "*"
    }
  ]
}

Version history

Current version v9, edited by AWS on 2026-02-12. Version history is recorded from 2026-11-11. Earlier versions are in the IAM console under Policy versions.

Attach snippets

AWS CLI

aws iam attach-role-policy --role-name ROLE_NAME --policy-arn arn:aws:iam::aws:policy/service-role/SageMakerStudioBedrockKnowledgeBaseServiceRolePolicy
aws iam attach-user-policy --user-name USER_NAME --policy-arn arn:aws:iam::aws:policy/service-role/SageMakerStudioBedrockKnowledgeBaseServiceRolePolicy
aws iam attach-group-policy --group-name GROUP_NAME --policy-arn arn:aws:iam::aws:policy/service-role/SageMakerStudioBedrockKnowledgeBaseServiceRolePolicy

CloudFormation

Resources:
  ExampleRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument: {}  # replace with your trust policy
      ManagedPolicyArns:
        - arn:aws:iam::aws:policy/service-role/SageMakerStudioBedrockKnowledgeBaseServiceRolePolicy

Terraform

resource "aws_iam_role_policy_attachment" "service_role_sagemakerstudiobedrockknowledgebaseservicerolepolicy" {
  role       = aws_iam_role.example.name
  policy_arn = "arn:aws:iam::aws:policy/service-role/SageMakerStudioBedrockKnowledgeBaseServiceRolePolicy"
}

CDK (TypeScript)

role.addManagedPolicy(
  iam.ManagedPolicy.fromAwsManagedPolicyName("service-role/SageMakerStudioBedrockKnowledgeBaseServiceRolePolicy"),
);

Sources

Pending editorial review. No editorial sources are listed yet.