- Newest
- Most votes
- Most comments
Based on your error message, it appears you're missing specific permissions needed to use the Converse operation with a Bedrock managed prompt.
When working with Bedrock's Prompt Management feature and the Converse API, you need to include additional permissions beyond just the standard InvokeModel permissions. The error specifically mentions that your account is not authorized to invoke the Converse operation with a prompt resource.
Try adding these additional permissions to your IAM role:
- "bedrock:Converse" - "bedrock:RenderPrompt" - "bedrock:CreateInvocation" - "bedrock:CreateSession" - "bedrock:ListInvocations" - "bedrock:ListSessions" - "bedrock:GetSession"
Make sure these permissions apply to the appropriate resources. You can either specify the exact ARNs or use a wildcard ("*") for testing purposes.
Also, verify that you're using the correct prompt identifier in your code. The prompt identifier should be the 10-character alphanumeric code found in the ARN (the part after "prompt/" in your ARN). Some users have encountered issues when passing the name of the prompt instead of this identifier.
If you're still experiencing issues after adding these permissions, check your CloudTrail logs to see if there are any additional clues about what specific permission might be missing.
Sources
Bedrock InvokeModel/Converse with Managed Prompt - AccessDenied | AWS re:Post
Bedrock Prompt Management - Access Denied | AWS re:Post
The auto-generated answer is correct for adding bedrock:Converse and may also need bedrock:ConverseStream. However, can you check CloudTrail for a more detailed error message about what access is being denied, since this isn't an explicit deny?
You may also need more than the noted List and Get actions for foundation models:
ListFoundationModels GetFoundationModels
I got the same error message and only adding the "bedrock:RenderPrompt" action on the "arn:aws:bedrock:${AWS::Region}:${AWS::AccountId}:prompt/*" resource solved the issue.
As far as I could see the other actions do not exist (converse uses invokeModel) or are only needed for Bedrock session management.
