
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: <code>cd cognito-appsync-bedrock/cdk</code> and install dependencies with <code>npm install</code>.Verify the active AWS account and region used by your AWS CLI, and bootstrap the environment if needed: <code>aws sts get-caller-identity</code>, <code>aws configure get region</code>, <code>./node_modules/.bin/cdk bootstrap aws://YOUR_ACCOUNT_ID/YOUR_AWS_REGION</code>.Build and deploy with <code>npm run build</code> and <code>npm run deploy</code>.Verify that <code>cdk-outputs.json</code> 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.