Skip to content

Commit 77aa63c

Browse files
authored
fix(bedrock): fix agent version issue (#441)
1 parent 8c1aed5 commit 77aa63c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lambda/bedrock-custom-resources/custom_resources/bedrock_agent_alias.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,10 @@ def list_unused_agent_versions(agent_id: str, session: boto3.Session) -> List[in
166166

167167
def get_version(routing_configuration: List[Dict]) -> str:
168168
if len(routing_configuration) == 1:
169-
return routing_configuration[0]["agentVersion"]
169+
try:
170+
return routing_configuration[0]["agentVersion"]
171+
except KeyError:
172+
return None
170173
else:
171174
return None
172175

0 commit comments

Comments
 (0)