Skip to content
v2.277.0

Experimental

@aws-cdk/aws-bedrock-agentcore-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

VpcConfigProps Struct ​

VPC configuration properties.

Only used when network mode is VPC.

Example ​

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';
import { aws_ec2 as ec2 } from 'aws-cdk-lib';

declare const securityGroup: ec2.SecurityGroup;
declare const subnet: ec2.Subnet;
declare const subnetFilter: ec2.SubnetFilter;
declare const vpc: ec2.Vpc;
const vpcConfigProps: bedrock_agentcore_alpha.VpcConfigProps = {
  vpc: vpc,

  // the properties below are optional
  allowAllOutbound: false,
  securityGroups: [securityGroup],
  vpcSubnets: {
    availabilityZones: ['availabilityZones'],
    onePerAz: false,
    subnetFilters: [subnetFilter],
    subnetGroupName: 'subnetGroupName',
    subnets: [subnet],
    subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
  },
};
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
from aws_cdk import aws_ec2 as ec2

# security_group: ec2.SecurityGroup
# subnet: ec2.Subnet
# subnet_filter: ec2.SubnetFilter
# vpc: ec2.Vpc

vpc_config_props = bedrock_agentcore_alpha.VpcConfigProps(
    vpc=vpc,

    # the properties below are optional
    allow_all_outbound=False,
    security_groups=[security_group],
    vpc_subnets=ec2.SubnetSelection(
        availability_zones=["availabilityZones"],
        one_per_az=False,
        subnet_filters=[subnet_filter],
        subnet_group_name="subnetGroupName",
        subnets=[subnet],
        subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
    )
)
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.*;
import software.amazon.awscdk.services.ec2.*;

SecurityGroup securityGroup;
Subnet subnet;
SubnetFilter subnetFilter;
Vpc vpc;

VpcConfigProps vpcConfigProps = VpcConfigProps.builder()
        .vpc(vpc)

        // the properties below are optional
        .allowAllOutbound(false)
        .securityGroups(List.of(securityGroup))
        .vpcSubnets(SubnetSelection.builder()
                .availabilityZones(List.of("availabilityZones"))
                .onePerAz(false)
                .subnetFilters(List.of(subnetFilter))
                .subnetGroupName("subnetGroupName")
                .subnets(List.of(subnet))
                .subnetType(SubnetType.PRIVATE_ISOLATED)
                .build())
        .build();
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;
using Amazon.CDK.AWS.EC2;

SecurityGroup securityGroup;
Subnet subnet;
SubnetFilter subnetFilter;
Vpc vpc;

var vpcConfigProps = new VpcConfigProps {
    Vpc = vpc,

    // the properties below are optional
    AllowAllOutbound = false,
    SecurityGroups = new [] { securityGroup },
    VpcSubnets = new SubnetSelection {
        AvailabilityZones = new [] { "availabilityZones" },
        OnePerAz = false,
        SubnetFilters = new [] { subnetFilter },
        SubnetGroupName = "subnetGroupName",
        Subnets = new [] { subnet },
        SubnetType = SubnetType.PRIVATE_ISOLATED
    }
};
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"
import "github.com/aws/aws-cdk-go/awscdk"

var securityGroup SecurityGroup
var subnet Subnet
var subnetFilter SubnetFilter
var vpc Vpc

vpcConfigProps := &VpcConfigProps{
	Vpc: vpc,

	// the properties below are optional
	AllowAllOutbound: jsii.Boolean(false),
	SecurityGroups: []ISecurityGroup{
		securityGroup,
	},
	VpcSubnets: &SubnetSelection{
		AvailabilityZones: []*string{
			jsii.String("availabilityZones"),
		},
		OnePerAz: jsii.Boolean(false),
		SubnetFilters: []SubnetFilter{
			subnetFilter,
		},
		SubnetGroupName: jsii.String("subnetGroupName"),
		Subnets: []ISubnet{
			subnet,
		},
		SubnetType: awscdk.Aws_ec2.SubnetType_PRIVATE_ISOLATED,
	},
}

Properties ​

allowAllOutboundoptionalbooleanallow_all_outboundoptionalboolallowAllOutboundoptionalBooleanAllowAllOutboundoptionalboolAllowAllOutboundoptional*bool = true #
Whether to allow the resource to send all network traffic (except ipv6).
notes

If set to false, you must individually add traffic rules to allow the resource to connect to network targets.

Do not specify this property if the securityGroups property is set. Instead, configure allowAllOutbound directly on the security group.

securityGroupsoptionalISecurityGroup[]security_groupsoptionaltyping.List[ISecurityGroup]securityGroupsoptionalList<ISecurityGroup>SecurityGroupsoptionalISecurityGroup[]SecurityGroupsoptional*[]ISecurityGroup #
The list of security groups to associate with the resource's network interfaces.

Default: If the resource is placed within a VPC and a security group is not specified by this prop, a dedicated security group will be created for this resource.

Only used if 'vpc' is supplied.

vpcIVpcvpcIVpcvpcIVpcVpcIVpcVpcIVpc required #
The VPC to deploy the resource to.
vpcSubnetsoptionalSubnetSelectionvpc_subnetsoptionalSubnetSelectionvpcSubnetsoptionalSubnetSelectionVpcSubnetsoptionalSubnetSelectionVpcSubnetsoptionalSubnetSelection #
Where to place the network interfaces within the VPC.

Default: the Vpc default strategy if not specified

This requires vpc to be specified in order for interfaces to actually be placed in the subnets. If vpc is not specify, this will raise an error.