From the course: Building Serverless Apps with AI Services on AWS

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Using Amazon Bedrock from serverless services

Using Amazon Bedrock from serverless services

- [Instructor] You can use Amazon Bedrock from AWS Lambda and AWS Step Functions with ease. If you want to use Bedrock with AWS Lambda, you just need to use the AWS SDK. The AWS SDK is a software development kit and it allows you to call the AWS services using an API. In this example, I'm using AWS SDK for JavaScript version 3 to invoke a Bedrock model. You need to pass the configuration to the SDK and invoke the model. The configuration contains the prompt, some data that the model needs, and then the model name. The result of invoking the model will be returned to the function. If you're using Amazon Bedrock from Lambda, you need to give permissions to the function to access the particular foundational model that you want to invoke. For that in your function configuration, you need to give that permission. In this example, I show you how you can configure it with AWS SAM. We are going to learn more about SAM in a following video. I will leave you a video with some resources for…

Contents