S2 is currently available in AWS regions, so private networking uses AWS PrivateLink. Equivalent options, such as GCP Private Service Connect, will be added as S2 expands to other clouds.
Regions
Create your VPC endpoint in the AWS region of the basin’s location, for exampleus-east-1 for aws:us-east-1. An endpoint service can only be found from its own region, unless you create a cross-region endpoint.
Cross-region endpoints can be created from
us-east-1, us-west-2, eu-north-1, and eu-central-1. Contact us if you need another region.Cross-region access also requires the vpce:AllowMultiRegion IAM permission.Setup with the AWS Console
These steps use the AWS console. To script the setup instead, see Setup with the AWS CLI.1
Get Service Name
In the S2 dashboard, open the Private Connectivity tab on the Basins page to find your PrivateLink service name.
The service name is also returned as

private_net.aws.service_name for each location by the list locations API, and shown by s2 location list:The service name is specific to your account and can differ from another account’s in the same location. It is only available once you have at least one basin in the location.
2
Navigate to VPC Endpoints
Search for VPC endpoint on the AWS console and select “Endpoints”.

3
Create Endpoint
Click on “Create Endpoint”.

4
Select Service Type
Select “PrivateLink Ready Partner Services”.

5
Verify Service
Enter the PrivateLink service name and click on “Verify Service”.

6
Select VPC
Select the appropriate VPC.

7
Enable Private DNS
Enable private DNS name.

8
Include Subnets
Include subnets.

9
Configure Security Groups
Select appropriate Security Groups.



The endpoint’s security group must allow inbound HTTPS (port 443) from your clients,
for example from your VPC’s CIDR range. Your clients’ security groups must allow
outbound HTTPS to the endpoint, which the default outbound rule already does.
Setup with the AWS CLI
The same setup with AWS CLI v2. Set these to your own values:VPC_ID: the VPC your S2 clients run in. The endpoint and its private DNS only serve that VPC, so each VPC with clients needs its own endpoint.SUBNET_IDS: one subnet in each Availability Zone where your clients run, at most one per zone. The endpoint gets a network interface in each, billed hourly. Clients in a zone without one still connect, but cross zones and pay for the transfer. The subnets need no internet access, and the endpoint can only use zones the service supports.
--service-regions to the last command, as in step 1):
PublicIp set to False are usually private subnets, which are a good fit for the endpoint.
For a cross-region endpoint, also set the location’s region and add --service-regions "$SERVICE_REGION" to step 1 and --service-region "$SERVICE_REGION" to step 4:
1
Check the Service
2
Enable DNS on the VPC
Private DNS needs both DNS attributes enabled on the VPC. Check them first:If either prints
false, enable it:3
Create a Security Group
Allow HTTPS (port 443) from the VPC:This allows the VPC’s primary CIDR range. Clients in a secondary CIDR range, a peered VPC, or behind a Transit Gateway need a rule for their range too:To list the VPC’s CIDR ranges, including secondary ones:
4
Create the Endpoint
vpce_ids.5
Wait Until Available
available, or in any other state that needs action, such as failed.Validate Your Connection
Run these from a VM in your VPC. SetBASIN to one of your basins in the location:
-
Check that the basin’s DNS name resolves to the endpoint’s private addresses, one per subnet, all in your VPC’s CIDR range:
If it still resolves to public addresses, clear DNS caches or wait a few moments.
-
Check that HTTPS works through each address. DNS can return any of them, so a broken zone causes failures for only some requests:
Each address should print
401, since the request has no access token.000means the connection through that address failed. Check that your clients’ security group allows outbound HTTPS and that the endpoint’s security group allows inbound HTTPS from them. If both do, contact us with the endpoint ID and the zone that fails. -
If you also send account requests over PrivateLink, set
S2_PRIVATE_DNS_NAMEand both endpoint overrides as described there. Then check that the private DNS name resolves to private addresses too, and make an account request:
Account Requests over PrivateLink
The setup above covers basin requests, such as appending to and reading from streams. Account requests, such as listing basins or issuing access tokens, go toa.s2.dev over the public internet by default.
To send account requests over PrivateLink too, set the account endpoint to the private DNS name of your VPC endpoint’s service. Like the service name, it is specific to the location and can differ between accounts. It is returned as private_net.aws.private_dns_name by the list locations API, shown as privatelink dns name by s2 location list, and returned as PrivateDnsName when you check the service with the AWS CLI:
A private DNS name only resolves to PrivateLink from a VPC that has an endpoint for that location’s service, with private DNS enabled. Use the name for a location your VPC has an endpoint for. If it has endpoints for several locations, any of their names works for account requests.
Remove the Endpoint
Delete the endpoint, then its security group once the endpoint is gone. Until then, deleting the security group fails because the endpoint still uses it:deleted or reports that the endpoint does not exist, then run the third.
Requests from the VPC then go over the public internet if it has internet access, and fail otherwise. Access tokens whose network policy only allows this endpoint are denied.
