class CodeInterpreterCustomBase
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Bedrock.Agentcore.Alpha.CodeInterpreterCustomBase |
Go | github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2#CodeInterpreterCustomBase |
Java | software.amazon.awscdk.services.bedrock.agentcore.alpha.CodeInterpreterCustomBase |
Python | aws_cdk.aws_bedrock_agentcore_alpha.CodeInterpreterCustomBase |
TypeScript (source) | @aws-cdk/aws-bedrock-agentcore-alpha ยป CodeInterpreterCustomBase |
Implements
IConstruct, IDependable, IResource, ICode, IGrantable, IConnectable
Extends
Resource
Implemented by
Code
Abstract base class for a Code Interpreter.
Contains methods and attributes valid for Code Interpreters either created with CDK or imported.
Initializer
new CodeInterpreterCustomBase(scope: Construct, id: string)
Parameters
- scope
Construct - id
string
Properties
| Name | Type | Description |
|---|---|---|
| code | string | The ARN of the code interpreter resource. |
| code | string | The id of the code interpreter. |
| connections | Connections | An accessor for the Connections object that will fail if this Browser does not have a VPC configured. |
| env | Resource | The environment this resource belongs to. |
| execution | IRole | The IAM role that provides permissions for the code interpreter to access AWS services. |
| grant | IPrincipal | The principal to grant permissions to. |
| node | Node | The tree node. |
| stack | Stack | The stack in which this resource is defined. |
| created | string | Timestamp when the code interpreter was created. |
| last | string | Timestamp when the code interpreter was last updated. |
| status? | string | The status of the code interpreter. |
codeInterpreterArn
Type:
string
The ARN of the code interpreter resource.
codeInterpreterId
Type:
string
The id of the code interpreter.
connections
Type:
Connections
An accessor for the Connections object that will fail if this Browser does not have a VPC configured.
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.
executionRole
Type:
IRole
The IAM role that provides permissions for the code interpreter to access AWS services.
grantPrincipal
Type:
IPrincipal
The principal to grant permissions to.
node
Type:
Node
The tree node.
stack
Type:
Stack
The stack in which this resource is defined.
createdAt?
Type:
string
(optional)
Timestamp when the code interpreter was created.
lastUpdatedAt?
Type:
string
(optional)
Timestamp when the code interpreter was last updated.
status?
Type:
string
(optional)
The status of the code interpreter.
Methods
| Name | Description |
|---|---|
| apply | Apply the given removal policy to this resource. |
| grant(grantee, ...actions) | Grants IAM actions to the IAM Principal. |
| grant | Grant invoke permissions on this code interpreter to an IAM principal. |
| grant | Grant read permissions on this code interpreter to an IAM principal. |
| grant | Grant invoke permissions on this code interpreter to an IAM principal. |
| metric(metricName, dimensions, props?) | Return the given named metric for this code interpreter. |
| metric | Creates a CloudWatch metric for tracking code interpreter errors. |
| metric | Creates a CloudWatch metric for tracking code interpreter api operations.. |
| metric | Creates a CloudWatch metric for tracking code interpreter invocations. |
| metric | Creates a CloudWatch metric for tracking code interpreter latencies. |
| metric | Creates a CloudWatch metric for tracking code interpreter session duration. |
| metric | Creates a CloudWatch metric for tracking code interpreter system errors. |
| metric | Creates a CloudWatch metric for tracking code interpreter throttles. |
| metric | Creates a CloudWatch metric for tracking code interpreter user errors. |
| 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).
grant(grantee, ...actions)
public grant(grantee: IGrantable, ...actions: string[]): Grant
Parameters
- grantee
IGrantableโ - The IAM principal to grant permissions to. - actions
stringโ - The actions to grant.
Returns
Grants IAM actions to the IAM Principal.
grantInvoke(grantee)
public grantInvoke(grantee: IGrantable): Grant
Parameters
- grantee
IGrantableโ - The IAM principal to grant invoke permissions to.
Returns
Grant invoke permissions on this code interpreter to an IAM principal.
grantRead(grantee)
public grantRead(grantee: IGrantable): Grant
Parameters
- grantee
IGrantableโ - The IAM principal to grant read permissions to.
Returns
Grant read permissions on this code interpreter to an IAM principal.
This includes both read permissions on the specific code interpreter and list permissions on all code interpreters.
grantUse(grantee)
public grantUse(grantee: IGrantable): Grant
Parameters
- grantee
IGrantableโ - The IAM principal to grant invoke permissions to.
Returns
Grant invoke permissions on this code interpreter to an IAM principal.
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 code interpreter.
By default, the metric will be calculated as a sum over a period of 5 minutes.
You can customize this by using the statistic and period properties.
metricErrorsForApiOperation(operation, props?)
public metricErrorsForApiOperation(operation: string, props?: MetricOptions): Metric
Parameters
- operation
string - props
Metricโ - Configuration options for the metric.Options
Returns
Creates a CloudWatch metric for tracking code interpreter errors.
metricForApiOperation(metricName, operation, props?)
public metricForApiOperation(metricName: string, operation: string, props?: MetricOptions): Metric
Parameters
- metricName
string - operation
string - props
Metricโ - Configuration options for the metric.Options
Returns
Creates a CloudWatch metric for tracking code interpreter api operations..
metricInvocationsForApiOperation(operation, props?)
public metricInvocationsForApiOperation(operation: string, props?: MetricOptions): Metric
Parameters
- operation
string - props
Metricโ - Configuration options for the metric.Options
Returns
Creates a CloudWatch metric for tracking code interpreter invocations.
metricLatencyForApiOperation(operation, props?)
public metricLatencyForApiOperation(operation: string, props?: MetricOptions): Metric
Parameters
- operation
string - props
Metricโ - Configuration options for the metric.Options
Returns
Creates a CloudWatch metric for tracking code interpreter latencies.
metricSessionDuration(props?)
public metricSessionDuration(props?: MetricOptions): Metric
Parameters
- props
Metricโ - Configuration options for the metric.Options
Returns
Creates a CloudWatch metric for tracking code interpreter session duration.
metricSystemErrorsForApiOperation(operation, props?)
public metricSystemErrorsForApiOperation(operation: string, props?: MetricOptions): Metric
Parameters
- operation
string - props
Metricโ - Configuration options for the metric.Options
Returns
Creates a CloudWatch metric for tracking code interpreter system errors.
metricThrottlesForApiOperation(operation, props?)
public metricThrottlesForApiOperation(operation: string, props?: MetricOptions): Metric
Parameters
- operation
string - props
Metricโ - Configuration options for the metric.Options
Returns
Creates a CloudWatch metric for tracking code interpreter throttles.
metricUserErrorsForApiOperation(operation, props?)
public metricUserErrorsForApiOperation(operation: string, props?: MetricOptions): Metric
Parameters
- operation
string - props
Metricโ - Configuration options for the metric.Options
Returns
Creates a CloudWatch metric for tracking code interpreter user errors.
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.

.NET
Go
Java
Python
TypeScript (