Skip to content
v2.274.0

ConnectionNetwork Class ​

VPC network placement for a Glue Connection.

A Glue connection targets a single subnet. Choose the placement with one of the mutually-exclusive factories — an explicit subnet, or a VPC to select one from — so a subnet paired with a VPC, or a subnet selection without a VPC, cannot be expressed.

Example ​

ts
declare const securityGroup: ec2.SecurityGroup;
declare const vpc: ec2.Vpc;
new glue.Connection(this, 'MyConnection', {
  type: glue.ConnectionType.NETWORK,
  securityGroups: [securityGroup],
  // vpcSubnets is optional - defaults to private subnets
  network: glue.ConnectionNetwork.vpc(vpc, { subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS }),
});

Methods ​

subnet(subnet: ISubnet): ConnectionNetwork // chainable@staticmethod def subnet(subnet: ISubnet) -> ConnectionNetworkpublic static ConnectionNetwork subnet(ISubnet subnet)public static ConnectionNetwork Subnet(ISubnet subnet)func Subnet(Subnet ISubnet) ConnectionNetworkstatic#
Pin the connection to a specific subnet.
1 parameter

Parameters

  • subnetsubnetsubnetsubnetSubnet — the subnet the connection targets.
vpc(vpc: IVpc, vpcSubnets?: SubnetSelection): ConnectionNetwork // chainable@staticmethod def vpc(vpc: IVpc, vpc_subnets: typing.Optional[SubnetSelection] = None) -> ConnectionNetworkpublic static ConnectionNetwork vpc(IVpc vpc, SubnetSelection vpcSubnets)public static ConnectionNetwork Vpc(IVpc vpc, SubnetSelection? vpcSubnets = null)func Vpc(Vpc IVpc, VpcSubnets SubnetSelection) ConnectionNetworkstatic#
Select the connection's subnet from a VPC.

Since a Glue connection targets a single subnet, the first subnet of the selection is used.

2 parameters

Parameters

  • vpcvpcvpcvpcVpc — the VPC to select a subnet from.
  • vpcSubnetsvpc_subnetsvpcSubnetsvpcSubnetsVpcSubnets — which subnets to select from.