Skip to main content

Command Palette

Search for a command to run...

How to Solve dependencyFailedException on AWS Bedrock

Updated
1 min read
How to Solve dependencyFailedException on AWS Bedrock

These days, i’m using AWS Bedrock to create Agents.
And i faced this error when testing my agents many times so i decided to write down the workaround that i found.

An error occurred (dependencyFailedException) when calling the InvokeAgent operation: Dependency resource: received model timeout/error exception from Bedrock. Try the request again

I’m using Pulumi to deploy my agent like this:

const agent = new aws.bedrock.AgentAgent("pulumi-example-agent", {
    agentName: "pulumi-example-agent",
    description: "Pulumi example agent with Lambda integration",
    agentResourceRoleArn: `${roleArn}`,
    idleSessionTtlInSeconds: 500,
    foundationModel: "arn:aws:bedrock:eu-west-1:XXXXXXXXXXXXXXX:inference-profile/eu.amazon.nova-pro-v1:0",  
    instruction: `You are a helpful assistant that can answer questions and help with tasks.`,
})

I had no issue on the deployment using Github Actions.
But when i tried to chat with my agent, i got the error.
After trying many things, i decided to swap out the Nova model for a Mistral one.

const agent = new aws.bedrock.AgentAgent("pulumi-example-agent", {
    agentName: "pulumi-example-agent",
    description: "Pulumi example agent with Lambda integration",
    agentResourceRoleArn: `${roleArn}`,
    idleSessionTtlInSeconds: 500,
    foundationModel: "arn:aws:bedrock:eu-west-1:XXXXXXXXXXXXXXX:inference-profile/eu.mistral.pixtral-large-2502-v1:0",  
    instruction: `You are a helpful assistant that can answer questions and help with tasks.`,
})

Redeployed targeting the new model, and … it worked !
No more weird error !
So if you face that issue, just ditch the Amazon Nova model for another one !

See you in the next one ;)