# AWS Bedrock

AWS Bedrock is a fully managed service from Amazon Web Services (AWS) that simplifies the process of building and scaling generative AI applications. 

## **Overview**

AWS Bedrock is a fully managed service from Amazon Web Services (AWS) that simplifies the process of building and scaling generative AI applications.
It provides access to a variety of high-performing foundation models (FMs) from leading AI companies such as AI21 Labs, Anthropic, Cohere, Meta, and Stability AI, as well as models developed by Amazon itself.

## AWS Bedrock Snippets

Listed below is a range of powerful and easy-to-use code snippets designed to help you get the most out of AWS Bedrock connector:

* [AI Text Composition - AWS Bedrock](https://tray.ai/documentation/snippets/ai-text-composition-aws-bedrock/)
* [AI JSON Composition - AWS Bedrock](https://tray.ai/documentation/snippets/ai-json-composition-aws-bedrock/)
* [AI Self Evaluation - AWS Bedrock](https://tray.ai/documentation/snippets/ai-self-evaluation-aws-bedrock/)
* [AI Planning Step for Agentic Frameworks - AWS Bedrock](https://tray.ai/documentation/snippets/ai-planning-agentic-frameworks-aws-bedrock/)

## Authentication

### AWS Bedrock authentication

When using the AWS Bedrock connector for the first time, you need to create a new authentication.
![aws-bedrock-auth-1](https://tray.ai/documentation/images/connectors/artificial-intelligence/aws-bedrock/1faXS2rGTajR8pyDG9qE2W_aws-bedrock-auth-1.png)
Name your authentication and specify the type ('Personal' or 'Organizational').
![aws-bedrock-auth-2](https://tray.ai/documentation/images/connectors/artificial-intelligence/aws-bedrock/ba2ZxNFVglZjWy33AYHYN_aws-bedrock-auth-2.png)
The next page asks you for your AccessKeyId, SecretAccessKey, and Region.
To learn how to get the AccessKeyId and SecretAccessKey refer to the [AWS auth creds](#aws-auth-creds) section.
For the region field, enter appropriate code for your region. For example, AWS region code for Europe (London), is `eu-west-2`.
![aws-bedrock-auth-3](https://tray.ai/documentation/images/connectors/artificial-intelligence/aws-bedrock/1bP5uLfahKA3Fo3ylf7aej_aws-bedrock-auth-3.png)
Once you have added this field to your Tray.io authentication pop-up window click the **Create authentication** button.
Go back to your settings authentication field (within the workflow builder properties panel), and select the recently added authentication from the available dropdown options . Your connector authentication setup is now complete.

### AWS auth creds

Follow the below step to create the AccessKeyId and SecretAccessKey.
Go to the **IAM service**.
![aws-bedrock-auth-iam-1](https://tray.ai/documentation/images/connectors/artificial-intelligence/aws-bedrock/3FtzU7lIjOxGpHuzsTtsHE_aws-bedrock-auth-iam-1.png)
Click on **Users** in the navigation pane.
![aws-bedrock-auth-iam-2](https://tray.ai/documentation/images/connectors/artificial-intelligence/aws-bedrock/YlMumIEIgAw2CQJaPPLxV_aws-bedrock-auth-iam-2.png)
Click the **Create user** button
![aws-bedrock-auth-iam-3](https://tray.ai/documentation/images/connectors/artificial-intelligence/aws-bedrock/52g5JccExkenlHSyAkxV3J_aws-bedrock-auth-iam-3.png)
Provide a username for the new user.
![aws-bedrock-auth-iam-4](https://tray.ai/documentation/images/connectors/artificial-intelligence/aws-bedrock/6l6K9repRw9ECLXa3Nbuis_aws-bedrock-auth-iam-4.png)
Attach policies that grant the necessary permissions for AWS Bedrock. This may include policies like `bedrock:*` actions.
![aws-bedrock-auth-iam-5](https://tray.ai/documentation/images/connectors/artificial-intelligence/aws-bedrock/3rXrKFzJmF1fjb01ozoNzl_aws-bedrock-auth-iam-5.png)
Review configurations and click **Create user.**
![aws-bedrock-auth-iam-6](https://tray.ai/documentation/images/connectors/artificial-intelligence/aws-bedrock/2dYgU7xlnS1RtjYQv6OBVj_aws-bedrock-auth-iam-6.png)
Once you have created the user you can create the access key using the **Create access key** button.
![aws-bedrock-auth-iam-7](https://tray.ai/documentation/images/connectors/artificial-intelligence/aws-bedrock/6guxOct0Yt3rGi7Wg2rDG4_aws-bedrock-auth-iam-7.png)
Select a suitable use case.
![aws-bedrock-auth-iam-8](https://tray.ai/documentation/images/connectors/artificial-intelligence/aws-bedrock/3vqVxLOWwtbsbsPXoKY8sG_aws-bedrock-auth-iam-8.png)
Optionally you can set the description, click the **Create access key** button.
![aws-bedrock-auth-iam-9](https://tray.ai/documentation/images/connectors/artificial-intelligence/aws-bedrock/dwtrsRjcL0nlE3LR9hSLs_aws-bedrock-auth-iam-9.png)
Make sure to save the credentials securely or download the .csv file, as this is the only time you can see or save them.
![aws-bedrock-auth-iam-10](https://tray.ai/documentation/images/connectors/artificial-intelligence/aws-bedrock/34RLjo0wKByz2UTnPKtZCV_aws-bedrock-auth-iam-10.png)
