You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/user/content/ingest-data/sql-server/self-hosted.md
+121Lines changed: 121 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,6 +70,123 @@ Select the option that works best for you.
70
70
71
71
{{< /tab >}}
72
72
73
+
{{< tab "Use AWS PrivateLink">}}
74
+
75
+
Materialize can connect to a SQL Server database through an [AWS PrivateLink](https://aws.amazon.com/privatelink/)
76
+
service. Your SQL Server database must be running on AWS in order to use this
77
+
option.
78
+
79
+
1. #### Create a target group
80
+
81
+
Create a dedicated [target group](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/create-target-group.html)
82
+
for your SQL Server instance with the following details:
83
+
84
+
a. Target type as **IP address**.
85
+
86
+
b. Protocol as **TCP**.
87
+
88
+
c. Port as **1433**, or the port that you are using in case it is not 1433.
89
+
90
+
d. Make sure that the target group is in the same VPC as the SQL Server
91
+
instance.
92
+
93
+
e. Click next, and register the respective SQL Server instance to the target
94
+
group using its IP address.
95
+
96
+
1. #### Create a Network Load Balancer (NLB)
97
+
98
+
Create a [Network Load Balancer](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/create-network-load-balancer.html)
99
+
that is **enabled for the same subnets** that the SQL Server instance is
100
+
in.
101
+
102
+
1. #### Create TCP listener
103
+
104
+
Create a [TCP listener](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/create-listener.html)
105
+
for your SQL Server instance that forwards to the corresponding target
106
+
group you created.
107
+
108
+
1. #### Verify security groups and health checks
109
+
110
+
Once the TCP listener has been created, make sure that the [health checks](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/target-group-health-checks.html)
111
+
are passing and that the target is reported as healthy.
112
+
113
+
If you have set up a security group for your SQL Server instance, you must
114
+
ensure that it allows traffic on the health check port.
115
+
116
+
**Remarks**:
117
+
118
+
a. Network Load Balancers do not have associated security groups. Therefore,
119
+
the security groups for your targets must use IP addresses to allow
120
+
traffic.
121
+
122
+
b. You can't use the security groups for the clients as a source in the
123
+
security groups for the targets. Therefore, the security groups for your
124
+
targets must use the IP addresses of the clients to allow traffic. For more
125
+
details, check the [AWS documentation](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/target-group-register-targets.html).
126
+
127
+
1. #### Create a VPC endpoint service
128
+
129
+
Create a VPC [endpoint service](https://docs.aws.amazon.com/vpc/latest/privatelink/create-endpoint-service.html)
130
+
and associate it with the **Network Load Balancer** that you’ve just
131
+
created.
132
+
133
+
Note the **service name** that is generated for the endpoint service.
134
+
135
+
**Remarks**:
136
+
137
+
By disabling [Acceptance Required](https://docs.aws.amazon.com/vpc/latest/privatelink/configure-endpoint-service.html#accept-reject-connection-requests),
138
+
while still strictly managing who can view your endpoint via IAM,
139
+
Materialze will be able to seamlessly recreate and migrate endpoints as we
140
+
work to stabilize this feature.
141
+
142
+
1. #### Create an AWS PrivateLink Connection
143
+
144
+
In Materialize, create a [`AWS PRIVATELINK`](/sql/create-connection/#aws-privatelink) connection that references the
145
+
endpoint service that you created in the previous step.
146
+
147
+
```mzsql
148
+
CREATE CONNECTION privatelink_svc TO AWS PRIVATELINK (
149
+
SERVICE NAME 'com.amazonaws.vpce.<region_id>.vpce-svc-<endpoint_service_id>',
150
+
AVAILABILITY ZONES ('use1-az1', 'use1-az2', 'use1-az3')
151
+
);
152
+
```
153
+
154
+
Update the list of the availability zones to match the ones that you are
155
+
using in your AWS account.
156
+
157
+
1. #### Configure the AWS PrivateLink service
158
+
159
+
Retrieve the AWS principal for the AWS PrivateLink connection you just
Follow the instructions in the [AWS PrivateLink documentation](https://docs.aws.amazon.com/vpc/latest/privatelink/add-endpoint-service-permissions.html)
176
+
to configure your VPC endpoint service to accept connections from the
177
+
provided AWS principal.
178
+
179
+
If your AWS PrivateLink service is configured to require acceptance of
180
+
connection requests, you must manually approve the connection request from
181
+
Materialize after executing the `CREATE CONNECTION` statement. For more
182
+
details, check the [AWS PrivateLink documentation](https://docs.aws.amazon.com/vpc/latest/privatelink/configure-endpoint-service.html#accept-reject-connection-requests).
183
+
184
+
**Note:** It might take some time for the endpoint service connection to
185
+
show up, so you would need to wait for the endpoint service connection to
186
+
be ready before you create a source.
187
+
188
+
{{< /tab >}}
189
+
73
190
{{< tab "Use an SSH tunnel">}}
74
191
75
192
To create an SSH tunnel from Materialize to your database, you launch an VM to
@@ -131,6 +248,10 @@ networking configuration, so start by selecting the relevant option.
0 commit comments