Amazon.Bedrock
AWS Access
First, you need to configure your AWS access. You can do this several ways, but here we're going to show you how to do that with an AWS Profile or Access Key ID and Secret Access Key.
Installation
Install the AWS CLI by following the instructions for your operating system from the official AWS documentation. Verify the installation by running the following command in your terminal:
Configuration
Option 1: Configure AWS CLI using AWS Access Key ID and Secret Access Key
Obtain your AWS Access Key ID and Secret Access Key:
Sign in to the AWS Management Console.
Navigate to the IAM dashboard.
Click on "Users" in the left sidebar and select your IAM user.
Click on the "Security credentials" tab.
Click on "Create access key" to generate a new Access Key ID and Secret Access Key.
Save the Access Key ID and Secret Access Key in a secure location.
Configure the AWS CLI with your Access Key ID and Secret Access Key by running the following command:
Follow the prompts to enter your Access Key ID, Secret Access Key, default region, and default output format.
Option 2: Configure AWS CLI using AWS Profile
Create a new AWS Profile by running the following command:
Replace <profile-name>
with your desired profile name.
Follow the prompts to enter your Access Key ID, Secret Access Key, default region, and default output format for the specified profile.
To use the AWS Profile in your commands, add the
--profile <profile-name>
flag. For example:
Verification To verify that your AWS CLI is configured correctly, run a simple command like:
Configure Amazon Bedrock Provider
You can configure the Bedrock provider one of three ways.
You can use declare an empty Bedrock constructor:
This configuration assumes you've defined an AWS Profile and have set it up on your local computer and your default Region Endpoint is USEast-1.
You can pass the Bedrock provider with a Region parameter.
This configuration configures your provides to use the specified AWS Region.
Finally, you can configure the Bedrock provider with an AWS Access Key ID and Secret Access Key parameters.
How to use Amazon Bedrock LLMs
Last updated