class AgentBase
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Bedrock.Alpha.AgentBase |
Go | github.com/aws/aws-cdk-go/awsbedrockalpha/v2#AgentBase |
Java | software.amazon.awscdk.services.bedrock.alpha.AgentBase |
Python | aws_cdk.aws_bedrock_alpha.AgentBase |
TypeScript (source) | @aws-cdk/aws-bedrock-alpha ยป AgentBase |
Implements
IConstruct, IDependable, IResource, IEnvironment, IAgent, IGrantable
Extends
Resource
Implemented by
Agent
Abstract base class for an Agent.
Contains methods and attributes valid for Agents either created with CDK or imported.
Initializer
new AgentBase(scope: Construct, id: string, props?: ResourceProps)
Parameters
- scope
Construct - id
string - props
ResourceProps
Properties
| Name | Type | Description |
|---|---|---|
| agent | string | The ARN of the agent. |
| agent | string | The ID of the Agent. |
| agent | string | The version of the agent. |
| env | Resource | The environment this resource belongs to. |
| grant | IPrincipal | The principal to grant permissions to. |
| node | Node | The tree node. |
| role | IRole | The IAM role associated to the agent. |
| stack | Stack | The stack in which this resource is defined. |
| kms | IKey | Optional KMS encryption key associated with this agent. |
| last | string | When this agent was last updated. |
agentArn
Type:
string
The ARN of the agent.
agentId
Type:
string
The ID of the Agent.
agentVersion
Type:
string
The version of the agent.
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed in a Stack (those created by
creating new class instances like new Role(), new Bucket(), etc.), this
is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like
Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be
different than the stack they were imported into.
grantPrincipal
Type:
IPrincipal
The principal to grant permissions to.
node
Type:
Node
The tree node.
role
Type:
IRole
The IAM role associated to the agent.
stack
Type:
Stack
The stack in which this resource is defined.
kmsKey?
Type:
IKey
(optional)
Optional KMS encryption key associated with this agent.
lastUpdated?
Type:
string
(optional)
When this agent was last updated.
Methods
| Name | Description |
|---|---|
| apply | Apply the given removal policy to this resource. |
| grant | Grant invoke permissions on this agent to an IAM principal. |
| metric | Creates a CloudWatch metric for tracking agent invocations. |
| on | Creates an EventBridge rule for agent events. |
| to | Returns a string representation of this construct. |
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
RemovalPolicy
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN).
grantInvoke(grantee)
public grantInvoke(grantee: IGrantable): Grant
Parameters
- grantee
IGrantableโ - The IAM principal to grant invoke permissions to.
Returns
Grant invoke permissions on this agent to an IAM principal.
metricCount(props?)
public metricCount(props?: MetricOptions): Metric
Parameters
- props
Metricโ - Configuration options for the metric.Options
Returns
Creates a CloudWatch metric for tracking agent invocations.
onEvent(id, options?)
public onEvent(id: string, options?: OnEventOptions): Rule
Parameters
- id
stringโ - Unique identifier for the rule. - options
Onโ - Configuration options for the event rule.Event Options
Returns
Creates an EventBridge rule for agent events.
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.

.NET
Go
Java
Python
TypeScript (