Closed jritsema closed 8 months ago
Hi @jritsema, could you run npm install
before cdk bootstrap
from within the same root directory (bedrock-agent-cdk
)? We will update this in the README. Thank you.
I had tried that.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @aws-cdk/aws-lambda-python-alpha@2.108.0-alpha.0
npm ERR! Found: aws-cdk-lib@2.87.0
npm ERR! node_modules/aws-cdk-lib
npm ERR! aws-cdk-lib@"2.87.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer aws-cdk-lib@"^2.108.0" from @aws-cdk/aws-lambda-python-alpha@2.108.0-alpha.0
npm ERR! node_modules/@aws-cdk/aws-lambda-python-alpha
npm ERR! @aws-cdk/aws-lambda-python-alpha@"^2.108.0-alpha.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: aws-cdk-lib@2.113.0
npm ERR! node_modules/aws-cdk-lib
npm ERR! peer aws-cdk-lib@"^2.108.0" from @aws-cdk/aws-lambda-python-alpha@2.108.0-alpha.0
npm ERR! node_modules/@aws-cdk/aws-lambda-python-alpha
npm ERR! @aws-cdk/aws-lambda-python-alpha@"^2.108.0-alpha.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
Also another thing I had to add.
--- a/agents/bedrock-agent-cdk/tsconfig.json
+++ b/agents/bedrock-agent-cdk/tsconfig.json
@@ -20,6 +20,7 @@
"inlineSources": true,
"experimentalDecorators": true,
"strictPropertyInitialization": false,
+ "types": ["node"],
"typeRoots": [
"./node_modules/@types"
]
@jritsema I have update README so you can find more information about that. There is also no need for @aws-lambda-python-alpha construct and no need for Docker. And you shouldn't need to add anything extra. Please make sure you copied the lates updated repository and if you face the same issue run npm install --force
. Let me know if that helps.
Great! Seems to be working now. Thanks @maxtybar!
@jritsema Yes, you are correct, it is inside cdk-resource-bedrock-agent.py
file. I actually did not intend to expose this because it was meant to serve just as an example of how you could deploy your agent and later be able to edit your agent's information (such as instruction, alias, version, etc.) in the AWS console. We have more robust, though not as customizable, agent deployment samples (such as this). Also, feel free to explore a full AWS CDK Construct here that has a better agent implementation that you could incorporate in your AWS CDK code. In the meantime, thank you for the feedback and I will incorporate it in the update!
I got the following error when following the instructions in bedrock-agent-cdk. /cc: @rppth
Here are my dependencies