# CodeInterpreterCustomProps

Properties for creating a CodeInterpreter resource.

Used as props by: [CodeInterpreterCustom](/cdk/api/v2/docs/aws-cdk-lib.aws_bedrockagentcore.CodeInterpreterCustom.html)

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

## Example

TypeScript:

```ts
// Create a custom execution role
const executionRole = new iam.Role(this, "CodeInterpreterExecutionRole", {
  assumedBy: new iam.ServicePrincipal("bedrock-agentcore.amazonaws.com"),
});

// Create code interpreter with custom execution role
const codeInterpreter = new agentcore.CodeInterpreterCustom(this, "MyCodeInterpreter", {
  codeInterpreterCustomName: "my_code_interpreter",
  description: "Code interpreter with custom execution role",
  networkConfiguration: agentcore.CodeInterpreterNetworkConfiguration.usingPublicNetwork(),
  executionRole: executionRole,
});
```

Python:

```python
# Create a custom execution role
execution_role = iam.Role(self, "CodeInterpreterExecutionRole",
    assumed_by=iam.ServicePrincipal("bedrock-agentcore.amazonaws.com")
)

# Create code interpreter with custom execution role
code_interpreter = agentcore.CodeInterpreterCustom(self, "MyCodeInterpreter",
    code_interpreter_custom_name="my_code_interpreter",
    description="Code interpreter with custom execution role",
    network_configuration=agentcore.CodeInterpreterNetworkConfiguration.using_public_network(),
    execution_role=execution_role
)
```

Java:

```java
// Create a custom execution role
Role executionRole = Role.Builder.create(this, "CodeInterpreterExecutionRole")
        .assumedBy(new ServicePrincipal("bedrock-agentcore.amazonaws.com"))
        .build();

// Create code interpreter with custom execution role
CodeInterpreterCustom codeInterpreter = CodeInterpreterCustom.Builder.create(this, "MyCodeInterpreter")
        .codeInterpreterCustomName("my_code_interpreter")
        .description("Code interpreter with custom execution role")
        .networkConfiguration(CodeInterpreterNetworkConfiguration.usingPublicNetwork())
        .executionRole(executionRole)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// Create a custom execution role
var executionRole = new Role(this, "CodeInterpreterExecutionRole", new RoleProps {
    AssumedBy = new ServicePrincipal("bedrock-agentcore.amazonaws.com")
});

// Create code interpreter with custom execution role
var codeInterpreter = new CodeInterpreterCustom(this, "MyCodeInterpreter", new CodeInterpreterCustomProps {
    CodeInterpreterCustomName = "my_code_interpreter",
    Description = "Code interpreter with custom execution role",
    NetworkConfiguration = CodeInterpreterNetworkConfiguration.UsingPublicNetwork(),
    ExecutionRole = executionRole
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// Create a custom execution role
executionRole := iam.NewRole(this, jsii.String("CodeInterpreterExecutionRole"), &RoleProps{
	AssumedBy: iam.NewServicePrincipal(jsii.String("bedrock-agentcore.amazonaws.com")),
})

// Create code interpreter with custom execution role
codeInterpreter := agentcore.NewCodeInterpreterCustom(this, jsii.String("MyCodeInterpreter"), &CodeInterpreterCustomProps{
	CodeInterpreterCustomName: jsii.String("my_code_interpreter"),
	Description: jsii.String("Code interpreter with custom execution role"),
	NetworkConfiguration: agentcore.CodeInterpreterNetworkConfiguration_UsingPublicNetwork(),
	ExecutionRole: executionRole,
})
```

## Properties

- `codeInterpreterCustomName`: string — The name of the code interpreter Valid characters are a-z, A-Z, 0-9, _ (underscore) The name must start with a letter and can be up to 48 characters long Pattern: [a-zA-Z][a-zA-Z0-9_]{0,47}.

  **Default:** auto generate

- `description`: string — Optional description for the code interpreter Valid characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and spaces The description can have up to 200 characters.

  **Default:** No description

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

  **Default:** A new role will be created.

- `networkConfiguration`: [CodeInterpreterNetworkConfiguration](/cdk/api/v2/docs/aws-cdk-lib.aws_bedrockagentcore.CodeInterpreterNetworkConfiguration.html) — Network configuration for code interpreter.

  **Default:** PUBLIC network mode

- `tags`: { [key: string]: string } — Tags (optional) A list of key:value pairs of tags to apply to this Code Interpreter resource.

  **Default:** {} - no tags
