This project deploys a lambda function that talks to Bedrock Claude 3 Sonnet and saves the output into a DynamoDB table.
git clone https://github.com/ppgmdev/cdk-intro.git
cd cdk-intro
npm install
npx cdk deployOnce the stack is deployed, you can change the lambda function name in the assistant.sh file in line 14.
FUNCTION_NAME="YOUR LAMBDA NAME"Once done, you can call the assistant from your terminal. Make sure you are at cdk-intro in your terminal.
sh assistant.sh "Create a list of 10 pop songs"Example output:
Response:
{"statusCode": 200, "body": "Here's a list of 10 popular pop songs:\n\n1. \"Blinding Lights\" by The Weeknd\n2. \"Levitating\" by Dua Lipa\n3. \"Watermelon Sugar\" by Harry Styles\n4. \"Savage\" by Beyoncé featuring Megan Thee Stallion\n5. \"Say So\" by Doja Cat\n6. \"Circles\" by Post Malone\n7. \"Rockstar\" by DaBaby featuring Roddy Ricch\n8. \"Rain on Me\" by Lady Gaga featuring Ariana Grande\n9. \"Toosie Slide\" by Drake\n10. \"Cardigan\" by Taylor Swift"}
npm run buildcompile typescript to jsnpm run watchwatch for changes and compilenpm run testperform the jest unit testsnpx cdk deploydeploy this stack to your default AWS account/regionnpx cdk diffcompare deployed stack with current statenpx cdk synthemits the synthesized CloudFormation template