Unstable Creation of Knowledge Base using CDK
Hi, I'm using AWS Lambda to deploy a CloudFormation template into my application, which includes an AWS Bedrock Knowledge Base. Sometimes, when I trigger the Lambda function, the deployment works smoothly. However, other times I encounter the following error message: "Resource handler returned message: 'The knowledge base storage configuration provided is invalid... Bad Authorization (Service: BedrockAgent, Status Code: 400, Request ID: ****)'".
Published Jul 24, 2024
Hi, I'm trying to use AWS Lambda to deploy a CloudFormation template into an application, but I'm encountering an issue.
My application includes an AWS Bedrock Knowledge Base. Sometimes when I trigger the Lambda function to deploy the CloudFormation template, it runs smoothly, but other times I get the following error message: "Resource handler returned message: 'The knowledge base storage configuration provided is invalid... Bad Authorization (Service: BedrockAgent, Status Code: 400, Request ID: ****)'".
I have followed the documentation for Creating a service role for Knowledge bases for Amazon Bedrock and Data access control for Amazon OpenSearch Serverless. Here is my code for the kb_role and data_access_policy:
Do I miss anything? Thank you for your help!