Skip to content
v2.274.0

Experimental

@aws-cdk/aws-bedrock-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

AgentAliasAttributes Struct ​

Attributes needed to create an import.

Example ​

ts
const cmk = new kms.Key(this, 'cmk', {});

// Assuming you have an existing agent and alias
const agent = bedrock.Agent.fromAgentAttributes(this, 'ImportedAgent', {
  agentArn: 'arn:aws:bedrock:region:account:agent/agent-id',
  roleArn: 'arn:aws:iam::account:role/agent-role',
});

const agentAlias = bedrock.AgentAlias.fromAttributes(this, 'ImportedAlias', {
  aliasId: 'alias-id',
  aliasName: 'my-alias',
  agentVersion: '1',
  agent: agent,
});

const agentVariant = bedrock.PromptVariant.agent({
  variantName: 'agent-variant',
  model: bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V1_0,
  agentAlias: agentAlias,
  promptText: 'Use the agent to help with: {{task}}. Please be thorough and provide detailed explanations.',
  promptVariables: ['task'],
});

new bedrock.Prompt(this, 'agentPrompt', {
  promptName: 'agent-prompt',
  description: 'Prompt for agent interactions',
  defaultVariant: agentVariant,
  variants: [agentVariant],
  kmsKey: cmk,
});

Properties ​

agentIAgentagentIAgentagentIAgentAgentIAgentAgentIAgentrequired#
The underlying agent for this alias.
agentVersionstringagent_versionstragentVersionStringAgentVersionstringAgentVersion*stringrequired#
The agent version for this alias.
aliasIdstringalias_idstraliasIdStringAliasIdstringAliasId*stringrequired#
The Id of the agent alias.
aliasNameoptionalstringalias_nameoptionalstraliasNameoptionalStringAliasNameoptionalstringAliasNameoptional*string#
The name of the agent alias.

Default: undefined - No alias name is provided