BrowserNetworkConfiguration Class
Network configuration for the Browser tool.
| Source | aws-bedrockagentcore/lib/network/network-configuration.ts |
|---|---|
| Type last changed |
Example
ts
const vpc = new ec2.Vpc(this, 'testVPC');
const codeInterpreter = new agentcore.CodeInterpreterCustom(this, "MyCodeInterpreter", {
codeInterpreterCustomName: "my_sandbox_interpreter",
description: "Code interpreter with isolated network access",
networkConfiguration: agentcore.BrowserNetworkConfiguration.usingVpc(this, {
vpc: vpc,
}),
});
codeInterpreter.connections.addSecurityGroup(new ec2.SecurityGroup(this, 'AdditionalGroup', { vpc }));
python
vpc = ec2.Vpc(self, "testVPC")
code_interpreter = agentcore.CodeInterpreterCustom(self, "MyCodeInterpreter",
code_interpreter_custom_name="my_sandbox_interpreter",
description="Code interpreter with isolated network access",
network_configuration=agentcore.BrowserNetworkConfiguration.using_vpc(self,
vpc=vpc
)
)
code_interpreter.connections.add_security_group(ec2.SecurityGroup(self, "AdditionalGroup", vpc=vpc))
java
Vpc vpc = new Vpc(this, "testVPC");
CodeInterpreterCustom codeInterpreter = CodeInterpreterCustom.Builder.create(this, "MyCodeInterpreter")
.codeInterpreterCustomName("my_sandbox_interpreter")
.description("Code interpreter with isolated network access")
.networkConfiguration(BrowserNetworkConfiguration.usingVpc(this, VpcConfigProps.builder()
.vpc(vpc)
.build()))
.build();
codeInterpreter.connections.addSecurityGroup(SecurityGroup.Builder.create(this, "AdditionalGroup").vpc(vpc).build());
csharp
// Install: dotnet add package Amazon.CDK.Lib
var vpc = new Vpc(this, "testVPC");
var codeInterpreter = new CodeInterpreterCustom(this, "MyCodeInterpreter", new CodeInterpreterCustomProps {
CodeInterpreterCustomName = "my_sandbox_interpreter",
Description = "Code interpreter with isolated network access",
NetworkConfiguration = BrowserNetworkConfiguration.UsingVpc(this, new VpcConfigProps {
Vpc = vpc
})
});
codeInterpreter.Connections.AddSecurityGroup(new SecurityGroup(this, "AdditionalGroup", new SecurityGroupProps { Vpc = vpc }));
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
vpc := ec2.NewVpc(this, jsii.String("testVPC"))
codeInterpreter := agentcore.NewCodeInterpreterCustom(this, jsii.String("MyCodeInterpreter"), &CodeInterpreterCustomProps{
CodeInterpreterCustomName: jsii.String("my_sandbox_interpreter"),
Description: jsii.String("Code interpreter with isolated network access"),
NetworkConfiguration: agentcore.BrowserNetworkConfiguration_UsingVpc(this, &VpcConfigProps{
Vpc: vpc,
}),
})
codeInterpreter.connections.AddSecurityGroup(ec2.NewSecurityGroup(this, jsii.String("AdditionalGroup"), &SecurityGroupProps{
Vpc: Vpc,
}))
Properties
connectionsmay be undefinedConnectionsconnectionsmay be undefinedConnectionsconnectionsmay be undefinedConnectionsConnectionsmay be undefinedConnectionsConnectionsmay be undefinedConnections #The connections object to the network.
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(): BrowserNetworkConfiguration // chainable@staticmethod def using_public_network() -> BrowserNetworkConfigurationpublic static BrowserNetworkConfiguration usingPublicNetwork()public static BrowserNetworkConfiguration UsingPublicNetwork()func UsingPublicNetwork() BrowserNetworkConfiguration static #Creates a public network configuration.
PUBLIC is the default network mode.
returns
Returns: A BrowserNetworkConfiguration. Run this tool to operate in a public environment with internet access, suitable for less sensitive or open-use scenarios.
usingVpc(scope: Construct, vpcConfig: VpcConfigProps): BrowserNetworkConfiguration // chainable@staticmethod def using_vpc(scope: Construct, vpc_config: VpcConfigProps) -> BrowserNetworkConfigurationpublic static BrowserNetworkConfiguration usingVpc(Construct scope, VpcConfigProps vpcConfig)public static BrowserNetworkConfiguration UsingVpc(Construct scope, VpcConfigProps vpcConfig)func UsingVpc(Scope Construct, VpcConfig VpcConfigProps) BrowserNetworkConfiguration static #Creates a network configuration from a VPC configuration.
1 parameter · returns
Parameters
vpcConfigvpc_configvpcConfigvpcConfigVpcConfig— - The VPC configuration.
Returns: A BrowserNetworkConfiguration.