This project is an integration between API Gateway and Bedrock. The calls to Bedrock are made by AWS Lambda. The API is secured with Amazon Cognito.
To install the project's dependencies and deploy to AWS, run the following:
pnpm install
cd apps/infra
npx cdk deploy
Please be aware that the CloudFormation stack is deployed in the eu-central-1
region, as Bedrock is currently unavailable in certain regions.
To call the API, run the following:
curl --header "Content-Type: text/plain" \
--header 'Authorization: <IdToken>' \
--request POST \
--data 'Who is the CEO of AWS?' \
'https://<ApiEndpoint>.amazonaws.com/prod'
In the curl
command <ApiEndpoint>
should be the API endpoint output (which is printed in the terminal after deployment) and <IdToken>
should be the ID Token from a registered user in Cognito.
Example response:
The CEO of Amazon Web Services (AWS) is Adam Selipsky. He became CEO of AWS in 2021, replacing Andy Jassy who became CEO of Amazon.