Network connections allow EMR Serverless Spark to access data sources, servers, and other services in your own virtual private cloud (VPC). This topic describes how to create a network connection and how to configure security group rules for the target service.
Prerequisites
A Serverless Spark workspace is created. For more information, see Create a workspace.
Usage limits
vSwitches are supported only in the following availability zones.
Create a network connection
-
Go to the Network Connection page.
-
Log on to the EMR console.
-
In the left navigation pane, choose .
-
On the Spark page, click the target workspace name.
-
On the EMR Serverless Spark page, in the left navigation pane, click Normal Network Connection.
-
-
On the Normal Network Connection page, click Create Network Connection.
-
In the Create Network Connection dialog box, configure the following parameters and click OK.
Parameter
Description
Name
Enter a name for the connection.
VPC
Select the same VPC as the EMR cluster.
If no VPC is available, click Create VPC to create one in the VPC console. For more information, see VPCs and vSwitches.
NoteIf your Serverless Spark application needs internet access, ensure that the network connection provides it. For example, you can deploy a public NAT gateway in the VPC to enable internet access for Serverless Spark instances. For more information, see Public NAT Gateway.
vSwitch
Select a vSwitch that is in the same VPC as the EMR cluster.
If no vSwitch is available in the current zone, click vSwitch to create one in the VPC console. For more information, see Create and manage vSwitches.
ImportantYou can select vSwitches only in specific zones. For more information, see Usage limits.
The network connection is created when Status changes to Succeeded.

Configure security group rules
After you create a network connection, you must allow the CIDR block of the vSwitch used by the connection in the security group of the cluster that hosts the target service. Otherwise, Serverless Spark cannot access the service. The following steps use an EMR on ECS cluster as an example.
-
Obtain the CIDR block of the vSwitch specified in the network connection.
Log on to the VPC console and go to the vSwitch page to obtain the CIDR block of the vSwitch.
-
Add a security group rule.
-
Log on to the EMR on ECS console.
-
On the EMR on ECS page, click the cluster ID of the target cluster.
-
On the Basic Information page, in the Security section, click the link next to Cluster Security Group.
-
On the Security Group Details page, in the Rules section, click Add Rule, configure the following parameters, and then click OK.
Parameter
Description
Protocol
The type of network protocol to allow. Default value: TCP.
NoteIf your network connection is used for Kerberos authentication, we recommend that you select UDP and open port 88. For more information about Kerberos authentication, see Enable Kerberos authentication.
Source
Enter the vSwitch CIDR block that you obtained in the previous step.
ImportantTo avoid security risks such as attacks from external users, do not set Authorization Object to 0.0.0.0/0.
Destination (Current Instance)
The destination port to open. For example, 9083.
-
What to do next
After you create a network connection and configure security group rules, you can select the network connection in an SQL session, a notebook session, or a batch job to access data sources in the VPC. For an end-to-end example that accesses a Hive Metastore in your own VPC, see Read from and write to HMS.