Class AgentBase
(experimental) Abstract base class for an Agent.
Inherited Members
Namespace: Amazon.CDK.AWS.Bedrock.Alpha
Assembly: Amazon.CDK.AWS.Bedrock.Alpha.dll
Syntax (csharp)
public abstract class AgentBase : Resource, IAgent, IResource, IConstruct, IDependable, IGrantable
Syntax (vb)
Public MustInherit Class AgentBase Inherits Resource Implements IAgent, IResource, IConstruct, IDependable, IGrantable
Remarks
Contains methods and attributes valid for Agents either created with CDK or imported.
Stability: Experimental
Synopsis
Constructors
AgentBase(Construct, string, IResourceProps?) | (experimental) Abstract base class for an Agent. |
Properties
AgentArn | (experimental) The ARN of the agent. |
AgentId | (experimental) The ID of the Agent. |
AgentVersion | (experimental) The version of the agent. |
GrantPrincipal | (experimental) The principal to grant permissions to. |
KmsKey | (experimental) Optional KMS encryption key associated with this agent. |
LastUpdated | (experimental) When this agent was last updated. |
Role | (experimental) The IAM role associated to the agent. |
Methods
GrantInvoke(IGrantable) | (experimental) Grant invoke permissions on this agent to an IAM principal. |
MetricCount(IMetricOptions?) | (experimental) Creates a CloudWatch metric for tracking agent invocations. |
OnEvent(string, IOnEventOptions?) | (experimental) Creates an EventBridge rule for agent events. |
Constructors
AgentBase(Construct, string, IResourceProps?)
(experimental) Abstract base class for an Agent.
protected AgentBase(Construct scope, string id, IResourceProps? props = null)
Parameters
- scope Construct
- id string
- props IResourceProps
Remarks
Contains methods and attributes valid for Agents either created with CDK or imported.
Stability: Experimental
Properties
AgentArn
(experimental) The ARN of the agent.
public abstract string AgentArn { get; }
Property Value
Remarks
Stability: Experimental
AgentId
(experimental) The ID of the Agent.
public abstract string AgentId { get; }
Property Value
Remarks
Stability: Experimental
AgentVersion
(experimental) The version of the agent.
public abstract string AgentVersion { get; }
Property Value
Remarks
Stability: Experimental
Attribute: true
GrantPrincipal
(experimental) The principal to grant permissions to.
public abstract IPrincipal GrantPrincipal { get; }
Property Value
Remarks
Stability: Experimental
KmsKey
(experimental) Optional KMS encryption key associated with this agent.
public abstract IKey? KmsKey { get; }
Property Value
Remarks
Stability: Experimental
LastUpdated
(experimental) When this agent was last updated.
public abstract string? LastUpdated { get; }
Property Value
Remarks
Stability: Experimental
Role
(experimental) The IAM role associated to the agent.
public abstract IRole Role { get; }
Property Value
Remarks
Stability: Experimental
Methods
GrantInvoke(IGrantable)
(experimental) Grant invoke permissions on this agent to an IAM principal.
public virtual Grant GrantInvoke(IGrantable grantee)
Parameters
- grantee IGrantable
- The IAM principal to grant invoke permissions to.
Returns
An IAM Grant object representing the granted permissions
Remarks
Default: - Default grant configuration:
- actions: ['bedrock:InvokeAgent']
- resourceArns: [this.agentArn]
Stability: Experimental
MetricCount(IMetricOptions?)
(experimental) Creates a CloudWatch metric for tracking agent invocations.
public virtual Metric MetricCount(IMetricOptions? props = null)
Parameters
- props IMetricOptions
- Configuration options for the metric.
Returns
A CloudWatch Metric configured for agent invocation counts
Remarks
Default: - Default metric configuration:
- namespace: 'AWS/Bedrock'
- metricName: 'Invocations'
- dimensionsMap: { AgentId: this.agentId }
Stability: Experimental
OnEvent(string, IOnEventOptions?)
(experimental) Creates an EventBridge rule for agent events.
public virtual Rule OnEvent(string id, IOnEventOptions? options = null)
Parameters
- id string
- Unique identifier for the rule.
- options IOnEventOptions
- Configuration options for the event rule.
Returns
An EventBridge Rule configured for agent events
Remarks
Default: - Default event pattern:
- source: ['aws.bedrock']
- detail: { 'agent-id': [this.agentId] }
Stability: Experimental