- Newest
- Most votes
- Most comments
The error you're encountering indicates that your IAM role lacks the necessary permissions to use the bedrock:InvokeModelWithResponseStream action on the specified inference profile.
To resolve this issue, you need to ensure your IAM role has the appropriate permissions to invoke Amazon Bedrock models using inference profiles. Here's what needs to be done:
-
Your IAM role needs permissions for both the
bedrock:InvokeModelWithResponseStreamaction and access to the specific inference profile you're trying to use. -
The policy should include permissions to:
- Invoke foundation models
- Access the specific inference profile (in this case, amazon.nova-lite-v1:0)
A policy that would grant these permissions would look something like this:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"bedrock:InvokeModel",
"bedrock:InvokeModelWithResponseStream"
],
"Resource": [
"arn:aws:bedrock:us-east-1::foundation-model/amazon.nova-lite-v1:0"
],
"Condition": {
"ArnLike": {
"bedrock:InferenceProfileArn": "arn:aws:bedrock:us-east-1:891757154467:inference-profile/us.amazon.nova-lite-v1:0"
}
}
},
{
"Effect": "Allow",
"Action": [
"bedrock:InvokeModel",
"bedrock:InvokeModelWithResponseStream"
],
"Resource": [
"arn:aws:bedrock:us-east-1:891757154467:inference-profile/us.amazon.nova-lite-v1:0"
]
}
]
}
Since this appears to be a lab environment, you should contact your lab administrator to request these permissions be added to your role. Explain that you need permissions for bedrock:InvokeModelWithResponseStream on the inference profile resource mentioned in the error message.
Sources
Prerequisites for running model inference - Amazon Bedrock
Configure fine-grained access to Amazon Bedrock models using Amazon SageMaker Unified Studio | Artificial Intelligence
Prerequisites for inference profiles - Amazon Bedrock
(AccessDeniedException) when calling the InvokeModel | AWS re:Post
