Skip to content

Error en Lab 1 del curso AWS Generative AI

0

Cuando quiero usar Bedrock, me da este error: User: arn:aws:sts::891757154467:assumed-role/AWSLabsUser-7TtXmTjrJEce3Zg5a4LyPs/793dee3b-3cc2-419f-b139-08bd34f29170 is not authorized to perform: bedrock:InvokeModelWithResponseStream on resource: arn:aws:bedrock:us-east-1:891757154467:inference-profile/us.amazon.nova-lite-v1:0 because no identity-based policy allows the bedrock:InvokeModelWithResponseStream action Check that your role has permissions to invoke the inference profile and retry your request. Necesito que me otorguen el permiso.

asked a year ago205 views

1 Answer
0
Accepted Answer

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:

  1. Your IAM role needs permissions for both the bedrock:InvokeModelWithResponseStream action and access to the specific inference profile you're trying to use.

  2. 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

answered a year ago

AWS
EXPERT

reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.