interface IBedrockAgentRuntime
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Bedrock.Agentcore.Alpha.IBedrockAgentRuntime |
Go | github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2#IBedrockAgentRuntime |
Java | software.amazon.awscdk.services.bedrock.agentcore.alpha.IBedrockAgentRuntime |
Python | aws_cdk.aws_bedrock_agentcore_alpha.IBedrockAgentRuntime |
TypeScript (source) | @aws-cdk/aws-bedrock-agentcore-alpha ยป IBedrockAgentRuntime |
Implemented by
Runtime
Obtainable from
Runtime.fromAgentRuntimeAttributes(), Runtime.addToRolePolicy()
Interface for Agent Runtime resources.
Properties
| Name | Type | Description |
|---|---|---|
| agent | string | The ARN of the agent runtime resource - Format arn:${Partition}:bedrock-agentcore:${Region}:${Account}:runtime/${RuntimeId}. |
| agent | string | The ID of the agent runtime. |
| agent | string | The name of the agent runtime. |
| connections | Connections | The network connections associated with this resource. |
| 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 that provides permissions for the agent runtime. |
| stack | Stack | The stack in which this resource is defined. |
| agent | string | The version of the agent runtime. |
| agent | string | The current status of the agent runtime. |
| created | string | The time at which the runtime was created. |
| last | string | The time at which the runtime was last updated. |
agentRuntimeArn
Type:
string
The ARN of the agent runtime resource - Format arn:${Partition}:bedrock-agentcore:${Region}:${Account}:runtime/${RuntimeId}.
Example
"arn:aws:bedrock-agentcore:us-west-2:123456789012:runtime/runtime-abc123"
agentRuntimeId
Type:
string
The ID of the agent runtime. Example
"runtime-abc123"
agentRuntimeName
Type:
string
The name of the agent runtime.
connections
Type:
Connections
The network connections associated with this resource.
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that 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 that provides permissions for the agent runtime.
stack
Type:
Stack
The stack in which this resource is defined.
agentRuntimeVersion?
Type:
string
(optional)
The version of the agent runtime.
agentStatus?
Type:
string
(optional)
The current status of the agent runtime.
createdAt?
Type:
string
(optional)
The time at which the runtime was created. Example
"2024-01-15T10:30:00Z"
lastUpdatedAt?
Type:
string
(optional)
The time at which the runtime was last updated. Example
"2024-01-15T14:45:00Z"
Methods
| Name | Description |
|---|---|
| add | Adds a policy statement to the runtime's execution role. |
| apply | Apply the given removal policy to this resource. |
| grant(actions, resources) | Grant the runtime specific actions on AWS resources. |
| grant | Permits an IAM principal to invoke this runtime both directly and on behalf of users Grants both bedrock-agentcore:InvokeAgentRuntime and bedrock-agentcore:InvokeAgentRuntimeForUser permissions. |
| grant | Permits an IAM principal to invoke this runtime Grants the bedrock-agentcore:InvokeAgentRuntime permission. |
| grant | Permits an IAM principal to invoke this runtime on behalf of a user Grants the bedrock-agentcore:InvokeAgentRuntimeForUser permission Required when using the X-Amzn-Bedrock-AgentCore-Runtime-User-Id header. |
| metric(metricName, dimensions, props?) | Return the given named metric for this agent runtime. |
| metric | Return a metric containing the total number of invocations for this agent runtime. |
| metric | Return a metric containing the total number of invocations across all resources. |
| metric | Return a metric measuring the latency of requests for this agent runtime. |
| metric | Return a metric containing the number of agent sessions for this agent runtime. |
| metric | Return a metric containing the total number of sessions across all resources. |
| metric | Return a metric containing the number of system errors for this agent runtime. |
| metric | Return a metric containing the number of throttled requests for this agent runtime. |
| metric | Return a metric containing the total number of errors (system + user) for this agent runtime. |
| metric | Return a metric containing the number of user errors for this agent runtime. |
addToRolePolicy(statement)
public addToRolePolicy(statement: PolicyStatement): IBedrockAgentRuntime
Parameters
- statement
Policyโ The IAM policy statement to add.Statement
Returns
Adds a policy statement to the runtime's execution role.
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).
grant(actions, resources)
public grant(actions: string[], resources: string[]): Grant
Parameters
- actions
string[]โ The actions to grant. - resources
string[]โ The resource ARNs to grant access to.
Returns
Grant the runtime specific actions on AWS resources.
grantInvoke(grantee)
public grantInvoke(grantee: IGrantable): Grant
Parameters
- grantee
IGrantableโ The principal to grant access to.
Returns
Permits an IAM principal to invoke this runtime both directly and on behalf of users Grants both bedrock-agentcore:InvokeAgentRuntime and bedrock-agentcore:InvokeAgentRuntimeForUser permissions.
grantInvokeRuntime(grantee)
public grantInvokeRuntime(grantee: IGrantable): Grant
Parameters
- grantee
IGrantableโ The principal to grant access to.
Returns
Permits an IAM principal to invoke this runtime Grants the bedrock-agentcore:InvokeAgentRuntime permission.
grantInvokeRuntimeForUser(grantee)
public grantInvokeRuntimeForUser(grantee: IGrantable): Grant
Parameters
- grantee
IGrantableโ The principal to grant access to.
Returns
Permits an IAM principal to invoke this runtime on behalf of a user Grants the bedrock-agentcore:InvokeAgentRuntimeForUser permission Required when using the X-Amzn-Bedrock-AgentCore-Runtime-User-Id header.
metric(metricName, dimensions, props?)
public metric(metricName: string, dimensions: { [string]: string }, props?: MetricOptions): Metric
Parameters
- metricName
string - dimensions
{ [string]: string } - props
MetricOptions
Returns
Return the given named metric for this agent runtime.
metricInvocations(props?)
public metricInvocations(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Return a metric containing the total number of invocations for this agent runtime.
metricInvocationsAggregated(props?)
public metricInvocationsAggregated(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Return a metric containing the total number of invocations across all resources.
metricLatency(props?)
public metricLatency(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Return a metric measuring the latency of requests for this agent runtime.
metricSessionCount(props?)
public metricSessionCount(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Return a metric containing the number of agent sessions for this agent runtime.
metricSessionsAggregated(props?)
public metricSessionsAggregated(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Return a metric containing the total number of sessions across all resources.
metricSystemErrors(props?)
public metricSystemErrors(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Return a metric containing the number of system errors for this agent runtime.
metricThrottles(props?)
public metricThrottles(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Return a metric containing the number of throttled requests for this agent runtime.
metricTotalErrors(props?)
public metricTotalErrors(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Return a metric containing the total number of errors (system + user) for this agent runtime.
metricUserErrors(props?)
public metricUserErrors(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Return a metric containing the number of user errors for this agent runtime.

.NET
Go
Java
Python
TypeScript (