interface IAgent
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Bedrock.Alpha.IAgent |
Go | github.com/aws/aws-cdk-go/awsbedrockalpha/v2#IAgent |
Java | software.amazon.awscdk.services.bedrock.alpha.IAgent |
Python | aws_cdk.aws_bedrock_alpha.IAgent |
TypeScript (source) | @aws-cdk/aws-bedrock-alpha ยป IAgent |
Implemented by
Agent
Obtainable from
Agent.fromAgentAttributes()
Represents an Agent, either created with CDK or imported.
Properties
| Name | Type | Description |
|---|---|---|
| agent | string | The ARN of the agent. |
| agent | string | The ID 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.
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 | Return the CloudWatch metric for agent count. |
| on | Defines a CloudWatch event rule triggered by agent events. |
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
Returns
Grant invoke permissions on this agent to an IAM principal.
Note: This grant will only work when the grantee is in the same AWS account where the agent is defined. Cross-account invocation is not supported.
metricCount(props?)
public metricCount(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Return the CloudWatch metric for agent count.
onEvent(id, options?)
public onEvent(id: string, options?: OnEventOptions): Rule
Parameters
- id
string - options
OnEvent Options
Returns
Defines a CloudWatch event rule triggered by agent events.

.NET
Go
Java
Python
TypeScript (