-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
custom resource returned: Error: 'agentVersion' #423
Comments
Hi @InitialXW , thank you for reporting this issue. I was not able to reproduce, however we are working on updating this construct to use the official L1 Bedrock constructs, which will remove the custom resource and probably fix this on your end. I will update this ticket when the work is done |
Also seeing this issue now since upgrading the package to version 0.1.140, can't actually deploy my stack at all now and this is blocking. Example to reproduce here: https://github.com/leegilmorecode/serverless-amazon-bedrock-agents |
@leegilmorecode do you also see this error in us-west-2 ? |
us-east-1 is where it was previously working fine. I’ve only updated this package from version 0.1.72 and I’m now getting the error. I can’t seem to get past it and deploy. |
@leegilmorecode, please see my suggested fix in my post to unblock you till there is a perm fix |
Describe the bug
custom resource returned error when creating Agent (errorred out in us-west-2, us-east-1 seems to be fine):
[BedrockCRProviderCustomResources log:
[ERROR] KeyError: 'agentVersion'
Traceback (most recent call last):
File "/var/task/custom_resources/init.py", line 47, in on_event
return on_event_bedrock_agent_alias(event, context)
File "/var/task/custom_resources/bedrock_agent_alias.py", line 81, in on_event
return on_create(event, str(uuid.uuid1()))
File "/var/task/custom_resources/bedrock_agent_alias.py", line 311, in on_create
response = create_agent_alias(agent_id, alias_name, session, agent_version, client_token)
File "/var/task/tenacity/init.py", line 289, in wrapped_f
return self(f, *args, **kw)
File "/var/task/tenacity/init.py", line 379, in call
do = self.iter(retry_state=retry_state)
File "/var/task/tenacity/init.py", line 314, in iter
return fut.result()
File "/var/lang/lib/python3.12/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
File "/var/lang/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/var/task/tenacity/init.py", line 382, in call
result = fn(*args, **kwargs)
File "/var/task/custom_resources/bedrock_agent_alias.py", line 200, in create_agent_alias
agent_version = get_version(
File "/var/task/custom_resources/bedrock_agent_alias.py", line 169, in get_version
return routing_configuration[0]["agentVersion"]
Expected Behavior
Agent create success
Current Behavior
cdk stack deployment fails
Reproduction Steps
import * as cdk from 'aws-cdk-lib';
import { bedrock } from '@cdklabs/generative-ai-cdk-constructs';
import { Construct } from 'constructs';
export interface KbStatefulProps extends cdk.StackProps {
}
export class KbStatefulStack extends cdk.Stack {
constructor(scope: Construct, id: string, props: KbStatefulProps) {
super(scope, id, props);
}
}
Possible Solution
bedrock_agent_alias.py line 169, change to 'return routing_configuration[0].get("agentVersion")'
Additional Information/Context
No response
CDK CLI Version
2.139.0 (build 2699ffd)
Framework Version
0.1.134
Node.js Version
20
OS
Linux
Language
Typescript
Language Version
No response
Region experiencing the issue
us-west-2
Code modification
no
Other information
No response
Service quota
The text was updated successfully, but these errors were encountered: