Skip to content
v2.275.0

Experimental

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

VpcConnectorProps Struct ​

Properties of the AppRunner VPC Connector.

Example ​

ts
import * as ec2 from 'aws-cdk-lib/aws-ec2';

const vpc = new ec2.Vpc(this, 'Vpc', {
  ipAddresses: ec2.IpAddresses.cidr('10.0.0.0/16')
});

const vpcConnector = new apprunner.VpcConnector(this, 'VpcConnector', {
  vpc,
  vpcSubnets: vpc.selectSubnets({ subnetType: ec2.SubnetType.PUBLIC }),
  vpcConnectorName: 'MyVpcConnector',
});

new apprunner.Service(this, 'Service', {
  source: apprunner.Source.fromEcrPublic({
    imageConfiguration: { port: 8000 },
    imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest',
  }),
  vpcConnector,
});

Properties ​

securityGroupsoptionalISecurityGroup[]security_groupsoptionaltyping.List[ISecurityGroup]securityGroupsoptionalList<ISecurityGroup>SecurityGroupsoptionalISecurityGroup[]SecurityGroupsoptional*[]ISecurityGroup#
A list of IDs of security groups that App Runner should use for access to AWS resources under the specified subnets.

Default: a new security group will be created in the specified VPC

vpcIVpcvpcIVpcvpcIVpcVpcIVpcVpcIVpcrequired#
The VPC for the VPC Connector.
vpcConnectorNameoptionalstringvpc_connector_nameoptionalstrvpcConnectorNameoptionalStringVpcConnectorNameoptionalstringVpcConnectorNameoptional*string#
The name for the VpcConnector.

Default: a name generated by CloudFormation

vpcSubnetsoptionalSubnetSelectionvpc_subnetsoptionalSubnetSelectionvpcSubnetsoptionalSubnetSelectionVpcSubnetsoptionalSubnetSelectionVpcSubnetsoptionalSubnetSelection#
Where to place the VPC Connector within the VPC.

Default: Private subnets.