## The problem
Issue aws-samples/amazon-bedrock-workshop#20 (closed, 25 comments): I receive the following error after running this line `boto3_bedrock.list_foundation_models()` in https://github.com/aws-samples/amazon-bedrock-workshop/blob/main/00_Intro/bedrock_boto3_setup.ipynb ``` NoCredentialsError Traceback (most recent call last) Cell In[11], line 1 ----> 1 boto3_bedrock.list_foundation_models() File [~/Downloads/repos/bedrock/.venv/lib/python3.11/site-packages/botocore/client.py:530]([a local notebook file path]]/...
## What to do
NoCredentialsError from list_foundation_models does not mean the client failed to build; boto3 creates the client fine and only fetches credentials lazily at request time. Verify with `aws sts get-caller-identity` (run `aws configure` from a real terminal, not a notebook cell, since notebook cells are not interactive). If you get AccessDenied instead, your account needs Bedrock model access: AWS Console > Bedrock > Model access, enable the models. Set AWS_DEFAULT_REGION to a region where Bedrock is enabled and AWS_PROFILE to your configured profile. BEDROCK_ASSUME_ROLE is only needed if you must assume a different role than your default identity for Bedrock calls.