Skip to content

AgentAlias

Source: src/AWS/Bedrock/AgentAlias.ts

An alias for an Amazon Bedrock Agent — a stable, invocable pointer to one or more agent versions.

An alias is what applications invoke (via bedrock-agent-runtime InvokeAgent). Creating an alias with no routingConfiguration snapshots the agent’s current DRAFT into a new immutable version and routes the alias to it, so redeploying an updated + prepared agent and recreating the alias publishes a new version.

Alias Pointing at the Current Agent

import * as Bedrock from "alchemy/AWS/Bedrock";
const agent = yield* Bedrock.Agent("assistant", {
foundationModel: "us.anthropic.claude-3-5-sonnet-20240620-v1:0",
instruction: "You are a helpful assistant.",
});
const alias = yield* Bedrock.AgentAlias("prod", {
agentId: agent.agentId,
});

Alias Pinned to a Specific Version

const alias = yield* Bedrock.AgentAlias("prod", {
agentId: agent.agentId,
routingConfiguration: [{ agentVersion: "3" }],
});