Closed aekundayo closed 11 months ago
resolved I switched from using
bedrock_runtime = bedrock.get_bedrock_client( assumed_role=os.environ.get("BEDROCK_ASSUME_ROLE", None), region=os.environ.get("AWS_DEFAULT_REGION", None) ) to using bedrockruntime = boto3.client(service_name='bedrock-runtime')
I have followed all the instructions in the read me, I created a role with amazon bedrock access. Allowing all actions. My user trusted to assume the role.
I can create the bedrock client and list the models but when I try and invoke the model I get the following error:
repos/amazon-bedrock-workshop/00_Intro/~/Documents/repos/amazon-bedrock-workshop/.genenv/lib/python3.10/site-packages/botocore/client.py:980), in BaseClient._make_api_call(self, operation_name, api_params) 978 error_code = parsed_response.get("Error", {}).get("Code") 979 error_class = self.exceptions.from_code(error_code) --> 980 raise error_class(parsed_response, operation_name) 981 else: 982 return parsed_response
AccessDeniedException: An error occurred (AccessDeniedException) when calling the InvokeModel operation: Your account is not authorized to invoke this API operation.
Is anyone running this off their local machine rather than in AWS sagemaker?