# RuntimeNetworkConfiguration

Network configuration for the Runtime.

Extends: NetworkConfiguration › RuntimeNetworkConfiguration

- Source: [`aws-bedrockagentcore/lib/network/network-configuration.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-bedrockagentcore/lib/network/network-configuration.ts#L229)
- Type last changed: v2.255.0 · 19 May 2026

## Example

```ts
const repository = new ecr.Repository(this, "TestRepository", {
  repositoryName: "test-agent-runtime",
});
const agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, "v1.0.0");

// Create or use an existing VPC
const vpc = new ec2.Vpc(this, 'MyVpc', {
  maxAzs: 2,
});

// Configure runtime with VPC
const runtime = new agentcore.Runtime(this, "MyAgentRuntime", {
  runtimeName: "myAgent",
  agentRuntimeArtifact: agentRuntimeArtifact,
  networkConfiguration: agentcore.RuntimeNetworkConfiguration.usingVpc(this, {
    vpc: vpc,
    vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS },
    // Optionally specify security groups, or one will be created automatically
    // securityGroups: [mySecurityGroup],
  }),
});
```

## 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(): RuntimeNetworkConfiguration // chainable` (static) — Creates a public network configuration.

  PUBLIC is the default network mode.

  **Returns:** A RuntimeNetworkConfiguration. Run the runtime in a public environment with internet access, suitable for less sensitive or open-use scenarios.

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

  **Parameters**

  - `scope` — - The construct scope for creating resources.
  - `vpcConfig` — - The VPC configuration.

  **Returns:** A RuntimeNetworkConfiguration.
