Part 1: Set up AWS PrivateLink
Choose one setup option:Before you start
Use an AWS identity that can describe your VPC and database instances, manage security groups, create Network Load Balancers and target groups, manage VPC endpoint services, and create IAM roles and inline policies. For cross-region access, it also needsvpce:AllowMultiRegion.
What you will build
Each option creates:- A security group for the load balancer with no inbound rules and outbound access only to your database security group on the database port.
- An inbound rule on your database security group that allows the load balancer on that port.
- A TCP target group containing the private IP addresses you register and maintain.
- An internal Network Load Balancer (NLB) in your private subnets, forwarding the database port to the target group.
- A VPC endpoint service that allows only Unblocked’s endpoint-manager role to connect.
- A verification role in the account that owns the endpoint service. Unblocked assumes it with your organization’s external ID to confirm ownership. It can read only the endpoint service’s allowed principals and its own trust policy.
Finding the target IPs
An NLB forwards to IP addresses, not RDS endpoint names. Find each database instance’s endpoint, then resolve its private IPv4 address. ReplaceINSTANCE_ID with your instance identifier and DATABASE_REGION with its AWS region.
Keeping the target IPs current
You own the target group and must update it when instance IP addresses or reader roles change. Unblocked cannot see or change your targets. Check them after:- Failover, when a reader becomes the writer and the old writer may return as a reader.
- AWS maintenance or hardware recovery that moves an instance to a new host.
- Changes to instance classes or the number of readers.
Same region or cross-region
If your database is inus-west-2, Unblocked matches your NLB’s Availability Zones by AZ ID, such as usw2-az1.
For a database in another region, add us-west-2 as a supported region of the endpoint service. The Terraform module does this automatically. AWS charges inter-region data transfer to the sending side. Choose NLB subnets in Availability Zones that support cross-region PrivateLink.
Option 1: Terraform
Option 1: Terraform
Use Terraform when you manage your AWS infrastructure with Terraform. The Unblocked PrivateLink module creates the network resources and verification role in your AWS provider’s region. It requires Terraform 1.5 or later and AWS provider 6.0 or later.
The module prefixes the verification role name with The module creates an empty target group. Register your target IPs in the database’s region. Replace the example IPs and adjust the port if needed.Keep the IPs current as described above. Do not manage targets with Continue with Connect in Unblocked.
Add the module
Add this configuration to your Terraform project. Replace the VPC, subnet, security group, and external ID values. Configure your AWS provider for the database’s region.In the Aurora PostgreSQL PrivateLink connection setup in Unblocked, click Copy under External ID generated by Unblocked. Use the full copied value forverification_external_id, replacing YOUR_EXTERNAL_ID below.
UnblockedPrivateLink-, so this example creates UnblockedPrivateLink-verification. Set port if your database uses a port other than 5432. Set auto_accept_connections = true to accept connections from the allowed principal automatically.If Terraform manages your database security group with inline
ingress blocks, omit database_security_group_id and allow the module’s nlb_security_group_id output on the database port in your own configuration. Otherwise, the next apply of that security group removes the module’s rule. When you omit this input, the NLB’s outbound access uses the VPC CIDR, or the CIDRs you specify in target_cidr_blocks, on the database port.Apply and register the targets
Apply the configuration:aws_lb_target_group_attachment resources alongside external target updates: a later apply can restore stale IPs and remove targets added by your automation.Print the service name and verification role ARN, and save the service ID for accepting the connection:Option 2: AWS CLI
Option 2: AWS CLI
Run these commands in Bash with AWS credentials for the account that owns your database. If you use zsh, including the default macOS shell, start 
Replace the example region, resource IDs, and target IPs with your values:Disable inbound security group enforcement for PrivateLink traffic. Without this setting, the empty inbound rules block Unblocked’s connections. Enable cross-zone load balancing and forward the database port to your target group:Wait until every target shows For a database in another region, run this version instead to add Allow only Unblocked’s endpoint-manager role to create endpoints, then print the service details:Allow the role to read only your endpoint service’s allowed principals and its own trust policy:Continue with Connect in Unblocked.
bash first. These examples rely on Bash splitting the subnet and target IP lists into separate arguments.In the Aurora PostgreSQL PrivateLink connection setup in Unblocked, click Copy under External ID generated by Unblocked. Use the full copied value for EXTERNAL_ID, replacing YOUR_EXTERNAL_ID below.
Create the security groups
Create the NLB security group. It starts with no inbound rules. Remove its default outbound rule, then allow only the database port to your database security group. Allow that traffic into your database security group:Create the target group
Create a TCP target group with IP targets and TCP health checks every 10 seconds. Set a 30-second deregistration delay and register your target IPs:Create the Network Load Balancer
Create an internal NLB in your private subnets with the security group you created:healthy.Create the endpoint service
Create a service that requires you to accept each connection. For automatic acceptance instead, replace--acceptance-required with --no-acceptance-required.For a database in us-west-2:us-west-2 as a supported region:Create the verification role
Unblocked assumes this role to confirm that you own the endpoint service before it creates its endpoint. The role name must start withUnblockedPrivateLink. Use the EXTERNAL_ID value you copied from Unblocked earlier, including the unblocked_privatelink_ prefix.Create a trust policy allowing only Unblocked’s endpoint-manager role, with your external ID:Option 3: AWS console
Option 3: AWS console
Work in your database’s region. These steps use port
5432; substitute your database port if it differs.1
Create the security groups
Open EC2 › Security Groups and choose Create security group. Name it
unblocked-privatelink-nlb and select your database’s VPC.Leave Inbound rules empty. Under Outbound rules, delete the default All traffic rule. Add Custom TCP, port 5432, with your database security group as the destination. Create the group.Open your database security group and edit its inbound rules. Add Custom TCP, port 5432, with the NLB security group as the source. Save.2
Create the target group
Open EC2 › Target Groups and choose Create target group. Choose IP addresses, name it
unblocked-privatelink, and select TCP, port 5432, and your database’s VPC.Set the health check protocol to TCP. Under advanced health check settings, set the healthy and unhealthy thresholds to 2 and the interval to 10 seconds.Choose Next, enter each target IP on port 5432, and choose Include as pending below. Create the target group. On its Attributes tab, set the deregistration delay to 30 seconds.3
Create the Network Load Balancer
Open EC2 › Load Balancers and create a Network Load Balancer named
unblocked-privatelink. Choose Internal and IPv4.Select your database’s VPC and at least two Availability Zones with private subnets. Select the NLB security group instead of the default group. Configure a TCP listener on port 5432 that forwards to your target group. Create the load balancer and wait for Active.On the Security tab, edit the security settings and clear Enforce inbound rules on PrivateLink traffic. Save. On the Attributes tab, enable Cross-zone load balancing.Open your target group’s Targets tab and wait for every target to become Healthy.4
Create the endpoint service
Open VPC › Endpoint services and choose Create endpoint service. Choose Network and select your NLB.Keep Require acceptance for endpoint selected, or clear it to accept connections from allowed principals automatically. Leave Enable private DNS name cleared. For cross-region access, add
us-west-2 under Supported Regions. Choose IPv4 and create the service.On Allow principals, add arn:aws:iam::029574882031:role/ExternalConnectionsEndpointManager.Copy the Service name and Service ID from Details.5
Create the verification role
In the Aurora PostgreSQL PrivateLink connection setup in Unblocked, click Copy under External ID generated by Unblocked.
Open IAM › Roles and choose Create role. Choose Custom trust policy to trust only Unblocked’s endpoint-manager role. Replace Choose Next, leave Add permissions empty, then choose Next again. Name the role Name the policy

YOUR_EXTERNAL_ID in this policy with the full copied value:UnblockedPrivateLinkVerification and create it. If you choose another name, it must start with UnblockedPrivateLink.Open the role and choose Add permissions › Create inline policy. Choose JSON and enter this policy with your region, account ID, service ID, and role name:verify-endpoint-service and create it. Copy the role’s ARN from its summary.Connect in Unblocked
Provide these values in your Aurora PostgreSQL PrivateLink setup:
Accept Unblocked’s connection
After Unblocked verifies the service and creates its endpoint, the connection waits in Pending acceptance. Check that its owner is Unblocked’s account,029574882031, before accepting. With automatic acceptance enabled, the connection becomes Available without this step.
In the console, open VPC › Endpoint services, select your service, and open Endpoint connections. Select Unblocked’s pending connection, then choose Actions › Accept endpoint connection request.
With the CLI, set the database region and service ID if they are not already set, then list requests:
029574882031, replacing the example endpoint ID:
Removing access
Reject Unblocked’s endpoint connection to cut off access. Removing its role from the allowed principals stops new endpoints but does not revoke an accepted connection.terraform destroy only if the Terraform configuration is dedicated to this integration.
Troubleshooting
Part 2: Set up a read-only role
If you already have a read-only role with access to the data you want Unblocked to read, and have granted it to a login user, skip the role and user setup below. Use that user’s credentials and continue to Enter database details in Unblocked.
default_transaction_read_only=on and a statement timeout. Give its login read permissions on only the data you want it to access.
Database prerequisites
Find the hostname, port, and database name
Use your cluster’s reader endpoint as the hostname, in the formatCLUSTER.cluster-ro-ID.REGION.rds.amazonaws.com. Unblocked routes traffic through PrivateLink and verifies the database’s TLS certificate against this hostname using the Amazon RDS certificate authority. Provide the RDS reader endpoint, rather than an IP address, NLB or VPC endpoint DNS name, custom endpoint, or your own DNS alias.
AWS console
- Open RDS in your database’s region and choose Databases.
- Select your cluster’s identifier, whose role is Regional cluster.
- On Connectivity & security, under Connect using, choose Endpoints. Note the Database name, Master username, and Port. Copy the endpoint whose Type is Reader; its name contains
.cluster-ro-. Also note the Writer endpoint for creating the database user. If the database name is empty, see If there is no database name.

AWS CLI
Run these commands in Bash with AWS credentials for your account. Replace the cluster identifier and region:None if none was specified when the cluster was created:
If there is no database name
The cluster’s database name is specified at creation time. If it is empty, connect to thepostgres database using one of the methods below and list the databases:
psql, you can also use \l. Choose the database containing your data. Set DB_NAME to that name before continuing with the CLI examples.
Create a read-only role and user
Create database users with SQL inside PostgreSQL. Run the following SQL as your cluster’s master user, with schema and table owners applying grants where required. Connect to the writer endpoint and to the database Unblocked will read. Readers cannot create roles, and schema and table grants apply within the database you connect to.Connect with RDS Query Editor
The Query Editor requires RDS Data API, which is not supported on T instance classes such asdb.t3 and db.t4g. Your AWS identity needs AmazonRDSDataFullAccess or the permissions listed in Using the Aurora query editor.
-
If Data API is disabled, open your cluster and choose Actions › Enable RDS Data API. You can also enable it with the CLI, replacing
CLUSTER_ARN: - On Connectivity & security, under Connect using, choose Query Editor, then Navigate to Query Editor. You can also choose Query editor in the RDS navigation.
-
In Connect to database, choose your cluster. Under Database username, choose Add new database credentials and enter your master username and password. Enter your database name, then connect. Query Editor stores these credentials in AWS Secrets Manager.

- Run the statements in Run the SQL in order.
Connect with psql
From a host that can reach the cluster, download the RDS certificate bundle:psql prompts for your password:
Run the SQL
The roleunblocked_readonly holds read permissions; the login unblocked inherits them. You can choose other names. Replace <database>, <schema>, <table>, and <password> with your own values wherever they appear.
1
Create the read-only role
This role cannot log in. You grant it to the login user later.
2
Allow database connections
3
List your schemas
Exclude PostgreSQL’s system schemas:
4
Grant read access
Run this block to grant schema usage and read access to existing tables and views, plus tables created later by the role running it:To choose schemas individually, or if Query Editor rejects the block, run these statements for each schema instead:Apply existing-object grants as an owner or a role with the required grant options. Missing grant authority can produce permission errors or warnings that no privileges were granted.Default privileges apply only to objects created by the specified role, or the current role when none is specified. If an application or migration role creates tables, configure its defaults too: run the statements as that role, or use
ALTER DEFAULT PRIVILEGES FOR ROLE with the appropriate role name and permissions. Repeat the schema grants for schemas added later. See PostgreSQL default privileges.5
Create the login user
Use a strong password. If you plan to test this login through Query Editor on Aurora PostgreSQL 14 or later, its password must use SCRAM-SHA-256. This is the default for new clusters on these versions. See Aurora password encryption if you use a custom configuration.In
psql, you can omit the password from CREATE USER and set it with \password unblocked to keep it out of command history.6
Grant the role to the user
7
Make sessions read-only by default (optional)
Unblocked already sets this on its connections. Set it on the login too if you want the same default for other clients. The read-only default does not replace permission grants.
Alternative: use pg_read_all_data on PostgreSQL 14 or later
Alternative: use pg_read_all_data on PostgreSQL 14 or later
Instead of creating and granting the custom role, create the login user as above and grant the predefined This grants read access to tables, views, and sequences in every schema, including ones created later. It applies across every database in the cluster that the login can connect to. Use it only if that scope is appropriate. Row-level security policies still apply. See PostgreSQL predefined roles.
pg_read_all_data role:Restrict access to specific tables or columns
Restrict access to specific tables or columns
Instead of the schema-wide table grants, grant schema usage:To expose all columns from specific tables:To expose only selected columns from a table instead:Table-level
SELECT allows every column. Use column grants on a table only when you have not also granted table-level SELECT. Unblocked lists ordinary and partitioned tables, and exposes only columns its user can read. It does not list views.See Managing PostgreSQL users and roles and PostgreSQL GRANT.Check the database user
Usepsql from the host you used for setup. Query Editor can check permissions and list tables, but it cannot test the reader hostname or the PrivateLink network path.
-
Connect to the reader endpoint as
unblockedwith TLS certificate verification: -
If you set the login’s read-only default, confirm that it returns
on: -
List the tables Unblocked can see:
-
Check write privileges on a table, including column-level grants. Replace
<schema>.<table>. The result should bef: -
Optionally, connect to the writer endpoint as
unblockedand try this against a disposable test table. The insert should fail withpermission denied for table:
Enter database details in Unblocked
Enter these values in the Aurora PostgreSQL connection settings, alongside your PrivateLink values:
Complete connection verification in Unblocked to check the PrivateLink path as well as your database credentials and TLS configuration.
Choose your environment
After verifying the connection, open Settings › Data Sources › Aurora PostgreSQL. Under Environment, choose Production for real business data or Development for test and sample data. If you change the environment, click Save Settings. Check Exposed tables to see which tables Unblocked can read with the configured database role.