To run these example notebooks, please follow these instructions.
- Fireup Amazon SageMaker Studio.
- Launch a Jupyter Notebook with the following runtime configurations:
- Downoad Bedrock Python SDK from here
- Unzip the SDK archive to access .whl files.
- Move the .whl files in to a new directory.
- Now start executing each cell in the Jupyter Notebooks and you should be in the game.
Create an IAM policy like this in the policy editor:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "BedrockPolicySid",
"Effect": "Allow",
"Action": "bedrock:ListFoundationModels",
"Resource": "*"
}
]
}
And give this policy a name called Bedrock Policy
Then go ahead and add this to the your SageMaker Execution Role, like this:
Now when you execute the bedrock.list_foundation_models()
it runs without any errors.