[{"data":1,"prerenderedAt":91},["ShallowReactive",2],{"pattern-cognito-appsync-bedrock":3},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":12,"deploy":14,"description":20,"extension":21,"framework":22,"gitHub":23,"highlight":6,"introBox":29,"language":35,"level":36,"meta":37,"patternArch":38,"resources":65,"s3URL":6,"services":6,"stem":85,"testing":86,"videoId":6,"__hash__":90},"patterns\u002Fpatterns\u002Fcognito-appsync-bedrock.json","AWS AppSync and Amazon Cognito to Amazon Bedrock via AWS Lambda",null,{"text":8},[9,10,11],"Delete the stack from the CDK project folder with \u003Ccode>cd cognito-appsync-bedrock\u002Fcdk\u003C\u002Fcode> and \u003Ccode>.\u002Fnode_modules\u002F.bin\u002Fcdk destroy AppsyncBedrockCognitoStack\u003C\u002Fcode>.","Confirm the destroy prompt, then verify in CloudFormation that \u003Ccode>AppsyncBedrockCognitoStack\u003C\u002Fcode> no longer exists.","Local files such as \u003Ccode>cdk-outputs.json\u003C\u002Fcode> and shared CDK bootstrap resources are not removed automatically.",[13],"content\u002Fcontributors\u002Fvidit-shah.json",{"text":15},[16,17,18,19],"Change to the CDK project folder: \u003Ccode>cd cognito-appsync-bedrock\u002Fcdk\u003C\u002Fcode> and install dependencies with \u003Ccode>npm install\u003C\u002Fcode>.","Verify the active AWS account and region used by your AWS CLI, and bootstrap the environment if needed: \u003Ccode>aws sts get-caller-identity\u003C\u002Fcode>, \u003Ccode>aws configure get region\u003C\u002Fcode>, \u003Ccode>.\u002Fnode_modules\u002F.bin\u002Fcdk bootstrap aws:\u002F\u002FYOUR_ACCOUNT_ID\u002FYOUR_AWS_REGION\u003C\u002Fcode>.","Build and deploy with \u003Ccode>npm run build\u003C\u002Fcode> and \u003Ccode>npm run deploy\u003C\u002Fcode>.","Verify that \u003Ccode>cdk-outputs.json\u003C\u002Fcode> was created because the integration tests depend on that file.","Create an AWS AppSync GraphQL API protected by Amazon Cognito that invokes Amazon Bedrock through an AWS Lambda resolver.","json","AWS CDK",{"template":24},{"repoURL":25,"templateURL":26,"projectFolder":27,"templateFile":28},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Fcognito-appsync-bedrock","serverless-patterns\u002Fcognito-appsync-bedrock","cognito-appsync-bedrock","cdk\u002Flib\u002Fcdk-stack.ts",{"headline":30,"text":31},"How it works",[32,33,34],"This sample project demonstrates how to secure an AWS AppSync GraphQL API with Amazon Cognito User Pools and route an authenticated mutation to an AWS Lambda resolver.","The Lambda function uses the AWS SDK for JavaScript v3 to invoke an Amazon Bedrock foundation model and returns the generated response back through AppSync to the caller.","This pattern deploys a Cognito User Pool and client, an AppSync API, a Lambda data source and resolver, and the IAM permissions required for Bedrock model invocation.","TypeScript","200",{},{"icon1":39,"icon2":44,"icon3":48,"icon4":52,"line1":56,"line2":60,"line3":62},{"x":40,"y":41,"service":42,"label":43},20,70,"appsync","AWS AppSync",{"x":45,"y":41,"service":46,"label":47},50,"lambda","AWS Lambda",{"x":49,"y":41,"service":50,"label":51},80,"bedrock","Amazon Bedrock",{"x":53,"y":40,"service":54,"label":55},40,"cognito","Amazon Cognito",{"from":57,"to":58,"label":59},"icon1","icon2","Invoke",{"from":58,"to":61,"label":59},"icon3",{"from":57,"to":63,"label":64},"icon4","Validate token",{"bullets":66},[67,70,73,76,79,82],{"text":68,"link":69},"AWS AppSync - Build GraphQL APIs with managed resolvers","https:\u002F\u002Faws.amazon.com\u002Fappsync\u002F",{"text":71,"link":72},"Amazon Cognito - User sign-up and sign-in for web and mobile apps","https:\u002F\u002Faws.amazon.com\u002Fcognito\u002F",{"text":74,"link":75},"AWS Lambda - Run resolver logic without managing servers","https:\u002F\u002Faws.amazon.com\u002Flambda\u002F",{"text":77,"link":78},"Amazon Bedrock - Access foundation models through a managed API","https:\u002F\u002Faws.amazon.com\u002Fbedrock\u002F",{"text":80,"link":81},"AWS CDK - Define cloud infrastructure in TypeScript","https:\u002F\u002Faws.amazon.com\u002Fcdk\u002F",{"text":83,"link":84},"Amazon Bedrock model parameters","https:\u002F\u002Fdocs.aws.amazon.com\u002Fbedrock\u002Flatest\u002Fuserguide\u002Fmodel-parameters.html","patterns\u002Fcognito-appsync-bedrock",{"text":87},[88,89],"Run the full test suite from the CDK project folder with \u003Ccode>npm run test\u003C\u002Fcode>.","When \u003Ccode>cdk-outputs.json\u003C\u002Fcode> exists, the live Cognito-AppSync-Bedrock integration test runs; otherwise only the local transport unit test runs.","Dv7-LPXuWR5BQ6Aas3SlhREVOqs5Y276Kf7840I_uZA",1786530924140]