Skip to content

Commit bae257c

Browse files
authored
chore: updated guide to privatelink (supabase#37186)
* chore: updated guide to privatelink * Rule 1 linting fixes * Added options regex to Rule 1 * fix: prettier and one more lint * fix linting on doc
1 parent be3e3d2 commit bae257c

File tree

2 files changed

+109
-29
lines changed

2 files changed

+109
-29
lines changed

apps/docs/content/guides/platform/privatelink.mdx

Lines changed: 108 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -35,33 +35,122 @@ To use PrivateLink with your Supabase project:
3535
- AWS VPC in the same region as your Supabase project
3636
- Appropriate permissions to accept Resource Shares, and create and manage endpoints
3737

38-
<Admonition type="caution">
38+
## Getting started
3939

40-
PrivateLink connections are region-specific. Your VPC and Supabase project must be in the same AWS region to establish the connection.
40+
#### Step 1: Contact Supabase support
4141

42-
</Admonition>
42+
Reach out to your Enterprise account manager or [contact our team](https://supabase.com/contact/enterprise) to initiate PrivateLink setup. During this initial contact, be prepared to provide:
4343

44-
## Getting started
44+
- Your Supabase organization slug
45+
- The specific projects you want to enable PrivateLink for (optional)
46+
- Your AWS Account ID(s)
47+
48+
#### Step 2: Accept resource share
49+
50+
Supabase will send you an AWS Resource Share containing the VPC Lattice Resource Configurations for your projects. To accept this share:
51+
52+
1. Login to your AWS Management Console, ensure you are in the AWS region where your Supabase project is located
53+
2. Navigate to the AWS Resource Access Manager (RAM) console
54+
{/* supa-mdx-lint-disable-next-line Rule004ExcludeWords */}
55+
3. Go to [Shared with me > Resource shares](https://console.aws.amazon.com/ram/home#SharedResourceShares)
56+
4. Locate the resource share from Supabase.
57+
- The resource share will have the format `cust-prod-[region]-pl-[organisation]-rc-share`
58+
5. Click on the resource share name to view details. Review the list of resource shares - it should only include resources of type vpc-lattice:ResourceConfiguration.
59+
6. Click **Accept resource share**
60+
7. Confirm the acceptance in the dialog box
61+
62+
{/* supa-mdx-lint-disable-next-line Rule004ExcludeWords */}
63+
After accepting, you'll see the resource configurations appear in your [Shared with me > Shared resources](https://console.aws.amazon.com/ram/home#SharedResources) section of the RAM console and the [PrivateLink and Lattice > Resource configurations](https://console.aws.amazon.com/vpcconsole/home#ResourceConfigs) section of the VPC console.
64+
65+
#### Step 3: Configure security groups
66+
67+
Ensure your security groups allow traffic on the appropriate ports:
68+
69+
1. Navigate to the [VPC console > Security Groups](https://console.aws.amazon.com/vpcconsole/home#SecurityGroups:)
70+
2. Create a new security group for the endpoint or service network by clicking [Create security group](https://console.aws.amazon.com/vpcconsole/home#CreateSecurityGroup:)
71+
3. Give your security group a descriptive name and select the appropriate VPC
72+
4. Add an inbound rule for:
73+
- Type: Postgres (TCP, port 5432)
74+
- Destination that is appropriate for your network. i.e. the subnet of your VPC or security group of your application instances
75+
5. Finish creating the security group by clicking **Create security group**
76+
77+
#### Step 4: Create connection
78+
79+
In your AWS account, you have two options to establish connectivity:
80+
81+
##### Option A: Create a PrivateLink endpoint
82+
83+
1. Navigate to the VPC console in your AWS account
84+
2. Go to [Endpoints](https://console.aws.amazon.com/vpcconsole/home#Endpoints:) in the left sidebar
85+
3. Click [Create endpoint](https://console.aws.amazon.com/vpcconsole/home#CreateVpcEndpoint:)
86+
4. Give your endpoint a name (e.g. `supabase-privatelink-[project name]`)
87+
5. Under Type, select **Resources**
88+
6. In the **Resource configurations** section select the appropriate resource configuration
89+
- The resource configuration name will be in the format `[organisation]-[project-ref]-rc`
90+
7. Select your VPC from the dropdown. This should match the VPC you selected for your security group in Step 3
91+
8. Enable the **Enable DNS name** option if you want to use a DNS record instead of the endpoints IP address(es)
92+
9. Choose the appropriate subnets for your network
93+
- AWS will provision a private ENI for you in each selected subnet
94+
- IP address type should be set to IPv4
95+
10. Choose the security group you created in Step 3.
96+
11. Click **Create endpoint**
97+
12. After creation, you will see the endpoint in the [Endpoints](https://console.aws.amazon.com/vpcconsole/home#Endpoints:) section with a status of "Available"
98+
13. For connectivity:
99+
- The IP addresses of the endpoint will be listed in the **Subnets** section of the endpoint details
100+
- The DNS record will be in the **Associations** section of the endpoint details in the **DNS Name** field if you enabled it in step 8
45101

46-
PrivateLink setup requires coordination between your team and Supabase. The process involves sharing your AWS Account ID(s) and accepting a Resource Share.
102+
##### Option B: Attach resource configuration to an existing VPC lattice service network
47103

48-
### Setup process
104+
1. **This method is only recommended if you have an existing VPC Lattice Service Network**
105+
2. Navigate to the VPC Lattice console in your AWS account
106+
3. Go to [Service networks](https://console.aws.amazon.com/vpcconsole/home#ServiceNetworks) in the left sidebar and select your service network
107+
4. In the service network details, go to the **Resource configuration associations** tab
108+
5. Click **Create associations**
109+
6. Select the appropriate **Resource configuration** from the dropdown
110+
7. Click **Save changes**
111+
8. After creation, you will see the resource configuration in the Resource configurations section of your service network with the status "Active"
112+
9. For connectivity, click on the association details and the domain name will be listed in the **DNS entries** section
49113

50-
1. **Contact Supabase Support**: Reach out to your Enterprise account manager or [contact our team](https://supabase.com/contact/enterprise) to initiate PrivateLink setup
51-
2. **Provide AWS Account Details**: Share your AWS Account ID(s) with our team. Optionally specify which Supabase projects you want to enable (otherwise all projects in your organization will be included)
52-
3. **Accept Resource Share**: Supabase will send you an AWS Resource Share containing the VPC Lattice Resource Configurations for your projects. Accept this share from your AWS console
53-
4. **Create Connection**: In your AWS account, either [create a PrivateLink endpoint](https://docs.aws.amazon.com/vpc/latest/privatelink/privatelink-access-resources.html) or [attach the Resource Configuration](https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-network-associations.html) to an existing VPC Lattice Service Network
54-
5. **Test Connectivity**: Verify the private connection is working correctly from your VPC
55-
6. **Update Applications**: Configure your applications to use the private connection details
56-
7. **Disable Public Connectivity**: Optionally, disable public internet access for your database to enforce private-only connectivity
114+
#### Step 5: Test connectivity
57115

58-
### DNS and connectivity
116+
Verify the private connection is working correctly from your VPC:
59117

60-
Once PrivateLink is configured:
118+
1. Launch an EC2 instance or use an existing instance in your VPC
119+
2. Install a Postgres client (e.g., `psql`)
120+
3. Test the connection using the private endpoint:
61121

62-
- You may configure a custom DNS record to point to your PrivateLink endpoint interface or the endpoints on.aws DNS record within your VPC
63-
- Applications will need to be updated to use the PrivateLink endpoint
64-
- Standard database monitoring and observability tools will continue to work through the private connection
122+
```bash
123+
psql "postgresql://[username]:[password]@[private-endpoint]:5432/postgres"
124+
```
125+
126+
You should see a successful connection without any public internet traffic.
127+
128+
#### Step 6: Update applications
129+
130+
Configure your applications to use the private connection details:
131+
132+
1. Update your database connection strings to use the private endpoint hostname
133+
2. Ensure your application instances are in the same VPC or connected VPCs
134+
3. Update any database connection pooling configurations
135+
4. Test application connectivity thoroughly
136+
137+
Example connection string update:
138+
139+
```
140+
# Before (public)
141+
postgresql://user:pass@db.[project-ref].supabase.co:5432/postgres
142+
143+
# After (private)
144+
postgresql://user:[email protected]:5432/postgres
145+
```
146+
147+
#### Step 8: Disable public connectivity (optional)
148+
149+
For maximum security, you can disable public internet access for your database:
150+
151+
1. Contact Supabase support to disable public connectivity
152+
2. Ensure all applications are successfully using the private connection
153+
3. Update any monitoring or backup tools to use the private endpoint
65154

66155
## Alpha limitations
67156

@@ -72,20 +161,10 @@ During the alpha phase:
72161

73162
## Compatibility
74163

75-
The PrivateLink endpoint behaves like a standard Postgres endpoint, allowing you to connect using:
164+
The PrivateLink endpoint is a layer 3 solution so behaves like a standard Postgres endpoint, allowing you to connect using:
76165

77166
- Direct Postgres connections using standard tools
78167
- Third-party database tools and ORMs (with the appropriate routing)
79-
- (PgBouncer Projects Only) Directly to the pooler.
80-
81-
## Use cases
82-
83-
PrivateLink is ideal for organizations requiring:
84-
85-
- **Regulatory Compliance**: Meeting strict data governance requirements that mandate private network connectivity
86-
- **Enhanced Security**: Eliminating public internet exposure for sensitive database workloads
87-
- **Corporate Policies**: Adhering to enterprise security policies that prohibit database connections over public networks
88-
- **Performance Optimization**: Benefiting from reduced latency through AWS's private network infrastructure
89168

90169
## Next steps
91170

supa-mdx-lint/Rule001HeadingCase.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# Can also specify a regex that is compatible with the [Rust regex crate](https://docs.rs/regex/latest/regex/).
55
may_uppercase = [
66
"[A-Z0-9]{2,5}s?",
7+
"Option [A-Z]",
78
"APIs",
89
"Add-ons?",
910
"Amazon RDS",

0 commit comments

Comments
 (0)