# ICodeInterpreterCustom

Interface for CodeInterpreterCustom resources.

Extends: ICodeInterpreterCustom
Extends: IResource, IGrantable, IConnectable, ICodeInterpreterCustomRef
Implemented by: CodeInterpreterCustom, CodeInterpreterCustomBase

- Source: [`aws-bedrockagentcore/lib/tools/code-interpreter.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-bedrockagentcore/lib/tools/code-interpreter.ts#L69)
- Type last changed: v2.255.0 · 19 May 2026

## Properties

- `codeInterpreterArn`: string (required) — The ARN of the code interpreter resource.

- `codeInterpreterCustomRef`: [CodeInterpreterCustomReference](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_bedrockagentcore.CodeInterpreterCustomReference.html) (required) — A reference to a CodeInterpreterCustom resource.

- `codeInterpreterId`: string (required) — The id of the code interpreter.

- `connections`: [Connections](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.Connections.html) (required) — The network connections associated with this resource.

- `createdAt`: string — Timestamp when the code interpreter was created.

- `env`: [ResourceEnvironment](/cdk/api/v2/docs/aws-cdk-lib.interfaces.ResourceEnvironment.html) (required) — 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.

- `executionRole`: [IRole](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) (required) — The IAM role that provides permissions for the code interpreter to access AWS services.

- `grantPrincipal`: [IPrincipal](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IPrincipal.html) (required) — The principal to grant permissions to.

- `lastUpdatedAt`: string — Timestamp when the code interpreter was last updated.

- `node`: [Node](/cdk/api/v2/docs/constructs.Node.html) (required) — The tree node.

- `stack`: [Stack](/cdk/api/v2/docs/aws-cdk-lib.Stack.html) (required) — The stack in which this resource is defined.

- `status`: string — The status of the code interpreter.

## Methods

- `applyRemovalPolicy(policy: RemovalPolicy): void` — 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: IGrantable, ...actions: string[]): Grant` — Grants IAM actions to the IAM Principal.

- `grantRead(grantee: IGrantable): Grant` — Grants `Get` and `List` actions on the Code Interpreter.

- `grantUse(grantee: IGrantable): Grant` — Grants `Invoke`, `Start`, and `Stop` actions on the Code Interpreter.

- `metric(metricName: string, props?: MetricOptions): Metric` — Return the given named metric for this code interpreter.

- `metricErrorsForApiOperation(operation: string, props?: MetricOptions): Metric` — Return a metric containing the number of errors for a specific API operation performed on this code interpreter.

- `metricForApiOperation(metricName: string, operation: string, props?: MetricOptions): Metric` — Return the given named metric related to the API operation performed on this code interpreter.

- `metricInvocationsForApiOperation(operation: string, props?: MetricOptions): Metric` — Return a metric containing the total number of API requests made for a specific code interpreter operation.

- `metricLatencyForApiOperation(operation: string, props?: MetricOptions): Metric` — Return a metric measuring the latency of a specific API operation performed on this code interpreter.

- `metricSessionDuration(props?: MetricOptions): Metric` — Return a metric measuring the duration of code interpreter sessions.

- `metricSystemErrorsForApiOperation(operation: string, props?: MetricOptions): Metric` — Return a metric containing the number of system errors for a specific API operation performed on this code interpreter.

- `metricThrottlesForApiOperation(operation: string, props?: MetricOptions): Metric` — Return a metric containing the number of throttled requests for a specific API operation performed on this code interpreter.

- `metricUserErrorsForApiOperation(operation: string, props?: MetricOptions): Metric` — Return a metric containing the number of user errors for a specific API operation performed on this code interpreter.

- `with(...mixins: IMixin[]): IConstruct` — Applies one or more mixins to this construct.

  Mixins are applied in order. The list of constructs is captured at the
  start of the call, so constructs added by a mixin will not be visited.

  **Parameters**

  - `mixins` — The mixins to apply.

  **Returns:** This construct for chaining
