ConnectionNetwork

class aws_cdk.aws_glue_alpha.ConnectionNetwork(*args: Any, **kwargs)

Bases: object

(experimental) 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.

Stability:

experimental

ExampleMetadata:

infused

Example:

# security_group: ec2.SecurityGroup
# vpc: ec2.Vpc

glue.Connection(self, "MyConnection",
    type=glue.ConnectionType.NETWORK,
    security_groups=[security_group],
    # vpcSubnets is optional - defaults to private subnets
    network=glue.ConnectionNetwork.vpc(vpc, subnet_type=ec2.SubnetType.PRIVATE_WITH_EGRESS)
)

Static Methods

classmethod subnet(subnet)

(experimental) Pin the connection to a specific subnet.

Parameters:

subnet (ISubnet) – the subnet the connection targets.

Stability:

experimental

Return type:

ConnectionNetwork

classmethod vpc(vpc, *, availability_zones=None, one_per_az=None, subnet_filters=None, subnet_group_name=None, subnets=None, subnet_type=None)

(experimental) Select the connection’s subnet from a VPC.

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

Parameters:
  • vpc (IVpc) – the VPC to select a subnet from.

  • availability_zones (Optional[Sequence[str]]) – Select subnets only in the given AZs. Default: no filtering on AZs is done

  • one_per_az (Optional[bool]) – If true, return at most one subnet per AZ. Default: false

  • subnet_filters (Optional[Sequence[SubnetFilter]]) – List of provided subnet filters. Default: - none

  • subnet_group_name (Optional[str]) – Select the subnet group with the given name. Select the subnet group with the given name. This only needs to be used if you have multiple subnet groups of the same type and you need to distinguish between them. Otherwise, prefer subnetType. This field does not select individual subnets, it selects all subnets that share the given subnet group name. This is the name supplied in subnetConfiguration. At most one of subnetType and subnetGroupName can be supplied. Default: - Selection by type instead of by name

  • subnets (Optional[Sequence[ISubnet]]) – Explicitly select individual subnets. Use this if you don’t want to automatically use all subnets in a group, but have a need to control selection down to individual subnets. Cannot be specified together with subnetType or subnetGroupName. Default: - Use all subnets in a selected group (all private subnets by default)

  • subnet_type (Optional[SubnetType]) – Select all subnets of the given type. At most one of subnetType and subnetGroupName can be supplied. Default: SubnetType.PRIVATE_WITH_EGRESS (or ISOLATED or PUBLIC if there are no PRIVATE_WITH_EGRESS subnets)

Default:

vpcSubnets - private subnets

Stability:

experimental

Return type:

ConnectionNetwork