> **Experimental**
>
> `@aws-cdk/aws-bedrock-agentcore-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# CodeInterpreterNetworkConfiguration

Network configuration for the Code Interpreter tool.

Extends: [NetworkConfiguration](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.NetworkConfiguration.html) › CodeInterpreterNetworkConfiguration
Obtainable from: CodeInterpreterNetworkConfiguration.usingPublicNetwork, CodeInterpreterNetworkConfiguration.usingSandboxNetwork, CodeInterpreterNetworkConfiguration.usingVpc

- Source: [`lib/network/network-configuration.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/@aws-cdk/aws-bedrock-agentcore-alpha/lib/network/network-configuration.ts#L186)

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as bedrock_agentcore_alpha from '@aws-cdk/aws-bedrock-agentcore-alpha';
const codeInterpreterNetworkConfiguration = bedrock_agentcore_alpha.CodeInterpreterNetworkConfiguration.usingPublicNetwork();
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_bedrock_agentcore_alpha as bedrock_agentcore_alpha

code_interpreter_network_configuration = bedrock_agentcore_alpha.CodeInterpreterNetworkConfiguration.using_public_network()
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.bedrock.agentcore.alpha.*;

CodeInterpreterNetworkConfiguration codeInterpreterNetworkConfiguration = CodeInterpreterNetworkConfiguration.usingPublicNetwork();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.Bedrock.Agentcore.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Bedrock.Agentcore.Alpha;

var codeInterpreterNetworkConfiguration = CodeInterpreterNetworkConfiguration.UsingPublicNetwork();
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import bedrock_agentcore_alpha "github.com/aws/aws-cdk-go/awsbedrockagentcorealpha"

codeInterpreterNetworkConfiguration := bedrock_agentcore_alpha.CodeInterpreterNetworkConfiguration_UsingPublicNetwork()
```

## Properties

- `connections`: [Connections](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.Connections.html) — The connections object to the network.

- `networkMode`: string — The network mode to use.

  Configure the security level for agent
  execution to control access, isolate resources, and protect sensitive data.

- `scope`: [Construct](/cdk/api/v2/docs/constructs.Construct.html) — The scope to create the resource in.

- `vpcSubnets`: [SubnetSelection](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.SubnetSelection.html) — The VPC subnets to use.

## Methods

- `usingPublicNetwork(): CodeInterpreterNetworkConfiguration // chainable` (static) — Creates a public network configuration.

  **Returns:** A CodeInterpreterNetworkConfiguration. Run this tool to operate in a public environment with internet access, suitable for less sensitive or open-use scenarios.

- `usingSandboxNetwork(): CodeInterpreterNetworkConfiguration // chainable` (static) — Creates a sandbox network configuration.

  **Returns:** A CodeInterpreterNetworkConfiguration. Run this tool in a restricted environment with limited Permissions and Encryption to enhance safety and reduce potential risks.

- `usingVpc(scope: Construct, vpcConfig: VpcConfigProps): CodeInterpreterNetworkConfiguration // chainable` (static) — Creates a network configuration from a VPC configuration.

  **Parameters**

  - `vpcConfig` — - The VPC configuration.

  **Returns:** A CodeInterpreterNetworkConfiguration.
