amazon-web-servicesamazon-bedrock

Amazon Bedrock Agent - Access denied when calling Bedrock. Check your request permissions and retry the request


I'm building an agent using AWS Bedrock, I have created a knowledge base and allowed AWS bedrock to configure access policies.

When I try to invoke the Agent I get the following error: Access denied when calling Bedrock. Check your request permissions and retry the request.

I have tried setting IAM permissions to AdministratorAccess for the service role.

Further, I have added these inline policies in addition to the AWS defined policies + Administrator access

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Statement1",
            "Effect": "Allow",
            "Action": [
                "bedrock:InvokeModel",
                "bedrock:*",
                "bedrock:QueryKnowledgeBase",
                "bedrock:Retrieve",
                "bedrock:RetrieveAndGenerate"
            ],
            "Resource": [
                "arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-v2",
                "arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-instant-v1",
                "arn:aws:bedrock:*:389743002678:knowledge-base/:knowledge-base-id"
            ]
        },
        {
            "Sid": "Statement2",
            "Effect": "Allow",
            "Action": [
                "bedrock:*",
                "s3:*"
            ],
            "Resource": [
                "*",
                "*",
                "*"
            ]
        }
    ]
}

Solution

  • It was an issue with access to the ‘Anthropic’ models. Please make sure that you submit a use case and get access to the models. You will be granted access usually within a few hours.