Skip to content
v2.274.0

RuntimeNetworkConfiguration Class ​

Network configuration for the Runtime.

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 ​

connectionsmay be undefinedConnectionsconnectionsmay be undefinedConnectionsconnectionsmay be undefinedConnectionsConnectionsmay be undefinedConnectionsConnectionsmay be undefinedConnections#
The connections object to the network.
networkModestringnetwork_modestrnetworkModeStringNetworkModestringNetworkMode*stringrequired#
The network mode to use.

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

scopemay be undefinedConstructscopemay be undefinedConstructscopemay be undefinedConstructScopemay be undefinedConstructScopemay be undefinedConstruct#
The scope to create the resource in.
vpcSubnetsmay be undefinedSubnetSelectionvpc_subnetsmay be undefinedSubnetSelectionvpcSubnetsmay be undefinedSubnetSelectionVpcSubnetsmay be undefinedSubnetSelectionVpcSubnetsmay be undefinedSubnetSelection#
The VPC subnets to use.

Methods ​

usingPublicNetwork(): RuntimeNetworkConfiguration // chainable@staticmethod def using_public_network() -> RuntimeNetworkConfigurationpublic static RuntimeNetworkConfiguration usingPublicNetwork()public static RuntimeNetworkConfiguration UsingPublicNetwork()func UsingPublicNetwork() RuntimeNetworkConfigurationstatic#
Creates a public network configuration.

PUBLIC is the default network mode.

returns

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@staticmethod def using_vpc(scope: Construct, vpc_config: VpcConfigProps) -> RuntimeNetworkConfigurationpublic static RuntimeNetworkConfiguration usingVpc(Construct scope, VpcConfigProps vpcConfig)public static RuntimeNetworkConfiguration UsingVpc(Construct scope, VpcConfigProps vpcConfig)func UsingVpc(Scope Construct, VpcConfig VpcConfigProps) RuntimeNetworkConfigurationstatic#
Creates a network configuration from a VPC configuration.
2 parameters · returns

Parameters

  • scopescopescopescopeScope — - The construct scope for creating resources.
  • vpcConfigvpc_configvpcConfigvpcConfigVpcConfig — - The VPC configuration.

Returns: A RuntimeNetworkConfiguration.