Amazon Redshift will no longer support the use of Python UDFs after June 30, 2026.
We will start enforcing it in phases. For more information on the details of Python end of life
and migration options, see the
blog post
Private connectivity with AWS PrivateLink
Amazon Redshift Serverless with express configuration uses a service-managed endpoint, so there are no VPCs, subnets, or security groups for you to configure, and it queries your data in place. To run queries against the regional endpoint from inside your own VPC, JDBC, ODBC, and other PostgreSQL clients use the PostgreSQL wire-protocol endpoint over an AWS PrivateLink interface VPC endpoint. This keeps database traffic off the public internet.
The connection uses an interface VPC endpoint with private DNS enabled, TCP port 5439,
the regional endpoint hostname, TLS hostname and certificate validation
(sslmode=verify-full), and a short-lived database credential. Run these
steps in the AWS account and AWS Region from which your application connects.
Interface VPC endpoints have their own hourly and data processing charges, separate from the charges for the express configuration.
Before you begin, confirm the following:
-
You can create and manage interface VPC endpoints and security groups.
-
Your client is in the selected VPC or has network connectivity to it, and the VPC has both
enableDnsSupportandenableDnsHostnamesset totrue. -
The client has AWS credentials with the
redshift-serverless:GetCredentialsandredshift-serverless:DbConnectpermissions,psql,jq, and an up-to-date trusted CA certificate bundle.
First, create the interface VPC endpoint in your VPC and grant your IAM principal permission to request database credentials for the express configuration. Create this endpoint when you want to query the express configuration privately from within your VPC, without traversing the public internet.
To create the interface VPC endpoint
-
For the VPC that contains your client, confirm that both
enableDnsSupportandenableDnsHostnamesare set totrue, and enable them if needed. Private DNS is what makes the regional endpoint hostname resolve to the private IP addresses of the interface VPC endpoint.aws ec2 modify-vpc-attribute --vpc-idvpc-id--enable-dns-support '{"Value":true}' --regionregionaws ec2 modify-vpc-attribute --vpc-idvpc-id--enable-dns-hostnames '{"Value":true}' --regionregion -
Create a security group for the endpoint to control which clients can open a connection:
aws ec2 create-security-group --group-name express-privatelink-endpoint \ --description "PrivateLink access to the express configuration" --vpc-idvpc-id--regionregion -
Allow inbound traffic on TCP 5439 from the client security group (preferred) or a specific client CIDR.
aws ec2 authorize-security-group-ingress --group-idendpoint-sg-id\ --protocol tcp --port 5439 --source-groupclient-sg-id--regionregionDon't allow
0.0.0.0/0as the source, because that exposes the endpoint to any source address. -
Create the interface VPC endpoint with private DNS enabled, against the endpoint service name for the express configuration, which has the form
com.amazonaws.. Place endpoint network interfaces in a subnet per client Availability Zone for high availability.region.redshift-serverless-expressaws ec2 create-vpc-endpoint --vpc-endpoint-type Interface \ --service-name com.amazonaws.region.redshift-serverless-express \ --vpc-idvpc-id--subnet-idssubnet-id\ --security-group-idsendpoint-sg-id--private-dns-enabled --regionregion -
The endpoint might take a few minutes to become available. Confirm that the endpoint status is
availableand thatPrivateDnsEnabledistrue:aws ec2 describe-vpc-endpoints --vpc-endpoint-idsendpoint-id--regionregion\ --query 'VpcEndpoints[0].{State:State,PrivateDnsEnabled:PrivateDnsEnabled}' -
Grant your IAM principal the
redshift-serverless:GetCredentialsandredshift-serverless:DbConnectpermissions.
After the endpoint becomes available, connect through it with a short-lived credential and full TLS verification.
To connect through the interface VPC endpoint
-
From the client, verify that the regional endpoint hostname resolves to the private IP addresses of the interface VPC endpoint:
getent hosts express-default.express.region.redshift-serverless.amazonaws.com -
Request a short-lived credential and keep it in shell variables. Don't print, log, or persist the password, and connect promptly.
CREDENTIAL=$(aws redshift-serverless get-credentials --workgroup-name express-default --regionregion) DB_USER=$(printf '%s' "$CREDENTIAL" | jq -r '.dbUser') export PGPASSWORD=$(printf '%s' "$CREDENTIAL" | jq -r '.dbPassword') -
Connect with full TLS verification, using the exact regional endpoint hostname and the trusted CA bundle on your system. Don't substitute an endpoint-specific DNS name or a raw IP address, which breaks certificate verification and routing.
psql "host=express-default.express.region.redshift-serverless.amazonaws.com port=5439 dbname=dev user=$DB_USER sslmode=verify-full sslrootcert=/etc/pki/tls/certs/ca-bundle.crt" -c "select 1;"The path
/etc/pki/tls/certs/ca-bundle.crtis the location on RHEL-family systems. Replace it with your system's CA bundle, for example/etc/ssl/certs/ca-certificates.crton Debian and Ubuntu or/etc/ssl/cert.pemon macOS. -
Clear the temporary credential once you are connected:
unset PGPASSWORD CREDENTIAL DB_USER