AWS Builder Center
No Endpoint Needed: Connecting to Redshift Across AWS Accounts with Transit Gateway

No Endpoint Needed: Connecting to Redshift Across AWS Accounts with Transit Gateway

Our Redshift warehouse hit its limit of 10 connected accounts, and a quota increase would take days. Here’s how we used a Transit Gateway that was already in place to connect another account with just two small changes, explained for readers with zero cloud background.

The request that hit a wall

A data team asked for something routine: let one more AWS account read from our data warehouse. The usual first step is adding that account to the warehouse's approved list. This time, all 10 slots were taken, and a quota increase would take days.
So we looked for another road. It turned out one was already built.

A quick tour

If you're new to AWS, here are the pieces involved, explained with things most Filipinos see every day.
  • VPC (Virtual Private Cloud): a gated subdivision. Each team's AWS account has its own private network. Residents move freely inside, but outsiders can't walk in.
  • Security group: the guard with a logbook. Each resource keeps a list of which addresses may enter, and through which door (port).
  • Amazon Redshift: the company bodega. A data warehouse that many teams pick up data from. Ours sits in its own subdivision.
  • VPC endpoint: a private pickup window. The bodega opens a window inside your subdivision so you can reach it privately. For Redshift, each account that gets a window uses one of only 10 slots.
  • Transit Gateway: the jeepney terminal. A central hub connecting many subdivisions. Its route tables work like signboards: a jeep only goes where the signboard says, and every trip needs a ride back.

Where we stood

All 10 pickup windows were taken. But the bodega already had a main counter of its own, a built-in endpoint inside its own subdivision that doesn't use a slot. And both subdivisions were already connected to the same jeepney terminal.
So we asked: what if the team just rode the jeep to the main counter? It took two small changes, one on the signboard and one in the guard's logbook.

The team's requests ride the Transit Gateway to the bodega's main counter, past the guard, and the replies ride back the same way.

Change 1: Put the team on the signboard

The jeep to the bodega was already running. The problem was the ride back.
Our team's subdivision only listed itself on the signboards for the VPN and internet lanes, not on the shared dev signboard the bodega uses. So requests could reach Redshift, but replies had no route home. The connection didn't fail with an error. It just hung until it timed out, which looks exactly like a firewall problem. It's the most common reason this setup fails.
The fix is route propagation: adding the team's address range to the bodega's route table. We manage our network with Landing Zone Accelerator (LZA), so any change made by hand would be undone on the next pipeline run. Instead, we added one line to the team's Transit Gateway attachment in  network-config.yaml .
Then we ran the pipeline and checked the route table in the console. The team's address range showed up as active and propagated.

Change 2: Add the team to the guard's logbook

Now the jeep could get there and back, but the guard at the bodega still didn't know the team. We added one inbound rule to the warehouse's security group, allowing Redshift's port (5439) from the team's address range.
Two things to know here:
  • You can't name the visitor's security group. Normally you can tell a guard "let in anyone wearing this ID badge" by referencing another security group. That only works over VPC peering, not across a Transit Gateway. You have to list addresses (CIDRs) instead.
  • Keep the list short. If the team's apps only run in a few subnets, allow those subnets instead of the whole VPC range. The narrower the entry, the fewer residents who can walk through the door.

Testing it

We tested from a small EC2 instance inside the team's subdivision. Our VPCs have no direct internet access, so we connected through SSM Session Manager instead of SSH.
We ran three checks, in order. The order matters, because the first one that fails tells you which change didn't land.
  1. DNS: Look up the warehouse's address. It should come back as private IPs. Nothing needed building here; the Redshift hostname already resolves to private addresses from any account.
  1. Network: Check that port 5439 on one of those IPs answers.
  1. Login: Connect with a database client over SSL, using a password from Secrets Manager, never one pasted into a ticket.
If something fails, the symptom points to the cause:
Symptom
Likely cause
Network check hangs, then times out
The ride back (Change 1) or the guard's rule (Change 2) is missing. Check the route table first.
Login says password authentication failed
The network works; check the username and database name
Worked yesterday, broken today
A pipeline run undid a manual change; put it in the config
The login row is worth remembering. An authentication error is good news: your traffic crossed the terminal, reached the bodega, and got past the guard. Stop debugging the network.

The trade-off

The jeep route has one real cost: it's wider than a pickup window.
A pickup window only leads to the bodega, and only in one direction. A signboard entry works for every jeep at the terminal. Once the team's subdivision is on the dev signboard, every other subdivision on that signboard (about 20 in our case) now has a route to it, not just the bodega.
Here's how we kept that safe:
  • A route isn't permission. Before adding the propagation, check the team's own security groups. A client-only account should accept nothing inbound from those ranges, so the new routes lead to locked doors.
  • We scoped the guard's list. The warehouse rule allows only the team's ranges, on one port.
  • We stayed inside one environment. Dev talks to dev. We would not use this pattern across a production and non-production boundary without a separate decision. Our network config blocks those routes on purpose.
  • Visibility is a bonus. If you turn on Transit Gateway flow logs, you can see who reaches the warehouse, something a pickup window doesn't show you.

What we got

The team connected without a new endpoint and without waiting on AWS.

Pickup window (usual way)
Jeep route (what we did)
Slots used
1 of 10 (none left)
0
New AWS resources
1 endpoint
none
Changes
endpoint + grantee + rule
1 config line + 1 security group rule
Added cost
endpoint pricing applies
$0
Waiting time
days, for a quota increase
the length of one pipeline run
The same route now works for any team already on the terminal, so the 10-slot limit stopped being a blocker for us.

What I learned

  • Look at what's already built before asking for more. The bodega's main counter and the jeepney terminal were there the whole time.
  • When a connection hangs, check the ride back first. A missing return route looks like a firewall problem but gives no error.
  • An authentication error means the network works. Stop debugging routes once you see it.
  • Change things where they're managed. With LZA, a console edit gets undone on the next pipeline run. Put it in the config.
  • A wider road needs a stricter guard. Scope security group rules tightly, and don't cross environment boundaries casually.
Quotas exist for good reasons, and sometimes the right answer is to request an increase and wait. But before you do, look around. In our case, the road we needed had been built long ago. We just had to put our name on the signboard.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article