> ## Documentation Index
> Fetch the complete documentation index at: https://s2.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Private Networking

> Set up AWS PrivateLink to connect an AWS VPC to S2 privately and keep traffic off the public internet.

AWS PrivateLink allows you to connect to S2 privately from your VPC, without exposing traffic to the public internet. You also benefit from significantly [reduced egress costs](https://s2.dev/pricing).

<Note>
  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.
</Note>

## Setup

<Steps>
  <Step title="Get Service Name from S2 Dashboard">
    Go to the S2 dashboard, in the Basins tab, expand the **Private Connectivity** section to find your PrivateLink service name.

    <Frame>
      <img src="https://mintcdn.com/streamstore/U551CY5wtdgysPG-/images/privatelink/s2-dashboard.png?fit=max&auto=format&n=U551CY5wtdgysPG-&q=85&s=ccd40214b2d678da4aa7f1f77d0bad9a" width="1924" height="486" data-path="images/privatelink/s2-dashboard.png" />
    </Frame>
  </Step>

  <Step title="Navigate to VPC Endpoints">
    Search for VPC endpoint on the AWS console and select **"Endpoints"**.

    <Frame>
      <img src="https://mintcdn.com/streamstore/U551CY5wtdgysPG-/images/privatelink/step-1.png?fit=max&auto=format&n=U551CY5wtdgysPG-&q=85&s=5f28e375ff848cb67953c111c6fedb9a" width="1999" height="1385" data-path="images/privatelink/step-1.png" />
    </Frame>
  </Step>

  <Step title="Create Endpoint">
    Click on **"Create Endpoint"**.

    <Frame>
      <img src="https://mintcdn.com/streamstore/U551CY5wtdgysPG-/images/privatelink/step-2.png?fit=max&auto=format&n=U551CY5wtdgysPG-&q=85&s=2ac969f1ae0f77483e5095f31e384a16" width="790" height="300" data-path="images/privatelink/step-2.png" />
    </Frame>
  </Step>

  <Step title="Select Service Type">
    Select **"PrivateLink Ready Partner Services"**.

    <Frame>
      <img src="https://mintcdn.com/streamstore/U551CY5wtdgysPG-/images/privatelink/step-3.png?fit=max&auto=format&n=U551CY5wtdgysPG-&q=85&s=b8cf6d3956eb72143313fd6d0d03f7ec" width="1999" height="780" data-path="images/privatelink/step-3.png" />
    </Frame>
  </Step>

  <Step title="Verify Service">
    Enter the PrivateLink service name from the S2 dashboard and click on **"Verify Service"**.

    <Frame>
      <img src="https://mintcdn.com/streamstore/U551CY5wtdgysPG-/images/privatelink/step-4.png?fit=max&auto=format&n=U551CY5wtdgysPG-&q=85&s=9fad871f56db418dd148829f11ab50a7" width="1999" height="422" data-path="images/privatelink/step-4.png" />
    </Frame>
  </Step>

  <Step title="Select VPC">
    Select the appropriate **VPC**.

    <Frame>
      <img src="https://mintcdn.com/streamstore/U551CY5wtdgysPG-/images/privatelink/step-5.png?fit=max&auto=format&n=U551CY5wtdgysPG-&q=85&s=215f0b7924565d88cb59ffd5d7b95e8a" width="1999" height="578" data-path="images/privatelink/step-5.png" />
    </Frame>
  </Step>

  <Step title="Enable Private DNS">
    Enable private DNS name.

    <Frame>
      <img src="https://mintcdn.com/streamstore/U551CY5wtdgysPG-/images/privatelink/step-6.png?fit=max&auto=format&n=U551CY5wtdgysPG-&q=85&s=751abaac651a014c83086c77fed23110" width="1999" height="486" data-path="images/privatelink/step-6.png" />
    </Frame>
  </Step>

  <Step title="Include Subnets">
    Include subnets.

    <Frame>
      <img src="https://mintcdn.com/streamstore/U551CY5wtdgysPG-/images/privatelink/step-7.png?fit=max&auto=format&n=U551CY5wtdgysPG-&q=85&s=9c8173f52c651f2685952b52c7bd57bb" width="1999" height="524" data-path="images/privatelink/step-7.png" />
    </Frame>
  </Step>

  <Step title="Configure Security Groups">
    Select appropriate **Security Groups**.

    <Frame>
      <img src="https://mintcdn.com/streamstore/U551CY5wtdgysPG-/images/privatelink/step-8.png?fit=max&auto=format&n=U551CY5wtdgysPG-&q=85&s=a9b2b97326d876fbe9e29db9bcc4d787" width="1999" height="210" data-path="images/privatelink/step-8.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/streamstore/U551CY5wtdgysPG-/images/privatelink/step-9.png?fit=max&auto=format&n=U551CY5wtdgysPG-&q=85&s=c291edff7000df36d4969e2e925155d4" width="1999" height="529" data-path="images/privatelink/step-9.png" />
    </Frame>

    <Note>
      HTTPS (port 443) must be allowed in both inbound and outbound security group rules.
      Access can be left open to `0.0.0.0/0` or, preferably, restricted to the PrivateLink
      endpoint's private IP address or CIDR range.
    </Note>
  </Step>
</Steps>

## Validate Your Connection

1. From a VM on your VPC, try resolving an S2 basin DNS record:

   ```bash theme={null}
   nslookup ${basin}.b.s2.dev
   ```

   You may need to clear caches or wait a few moments for this to take effect.

2. If everything has worked, this DNS record should resolve to a private IPv4 address (e.g., starting with `10.*`).
