
Create an AWS AppSync GraphQL API protected by Amazon Cognito that invokes Amazon Bedrock through an AWS Lambda resolver.
git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/cognito-appsync-bedrockChange to the CDK project folder: cd cognito-appsync-bedrock/cdk and install dependencies with npm install.Verify the active AWS account and region used by your AWS CLI, and bootstrap the environment if needed: aws sts get-caller-identity, aws configure get region, ./node_modules/.bin/cdk bootstrap aws://YOUR_ACCOUNT_ID/YOUR_AWS_REGION.Build and deploy with npm run build and npm run deploy.Verify that cdk-outputs.json was created because the integration tests depend on that file.npm run test.cdk-outputs.json exists, the live Cognito-AppSync-Bedrock integration test runs; otherwise only the local transport unit test runs.cd cognito-appsync-bedrock/cdk and ./node_modules/.bin/cdk destroy AppsyncBedrockCognitoStack.AppsyncBedrockCognitoStack no longer exists.cdk-outputs.json and shared CDK bootstrap resources are not removed automatically.