Migrating Off Heroku Private Spaces to AWS: A Feature-by-Feature Map for Peering, VPN, Static IPs and Shield
How to replicate every Heroku Private Spaces networking and Shield feature in your own AWS VPC: peering, IPsec VPN, stable outbound IPs, Trusted IP Ranges, internal routing, space-level log drains and private Postgres, with AWS prices, a cutover sequence and who can help you do it.
Every Heroku Private Spaces feature has a direct AWS equivalent. The space becomes a three-AZ VPC, peering becomes VPC peering or AWS Transit Gateway, the VPN becomes AWS Site-to-Site VPN, stable outbound IPs become NAT gateways with Elastic IPs, Trusted IP Ranges become security groups or AWS WAF, and private Heroku Postgres becomes Amazon RDS in private subnets.
Your outbound IPs will change, and partner allowlists are the slowest part of the cutover. Heroku's stable IPs belong to Heroku and cannot move to your account. Allocate your Elastic IPs in week one and get every partner, bank and SaaS allowlist updated before any traffic moves.
Heroku Shield and AWS Shield are unrelated products. Heroku Shield is a compliance tier (HIPAA, PCI DSS Level 1). AWS Shield is DDoS protection; Shield Standard is free and Shield Advanced costs $3,000 per month on a one-year commitment (AWS Shield pricing). You rebuild Heroku Shield with an AWS BAA, KMS encryption, private RDS and session logging.
Heroku Postgres does not support logical replication (Heroku roadmap issue #38, open since 2022), so plan the database move as pg_dump and pg_restore with a short write freeze, or an application-level sync for large databases. On Shield, pg:psql and PGBackups are disabled, so you export through AWS PrivateLink or a one-off dyno inside the space.
Three kinds of help exist: AWS partners and consultancies for the one-time lift, Terraform modules if you have platform engineers, and platforms such as Qovery that provision the VPC, NAT gateways and EKS cluster in your own AWS account and keep a git-push workflow afterwards.
Teams who want out of Heroku Private Spaces come to me for different reasons (price, a second region, an auditor asking for keys in their own account), but the first technical question is nearly always the same: "We have peering, a VPN to the office, four IPs our bank allowlisted and a Shield space. What does each of those become on AWS, and in what order do we move them?"
What exactly do you have to rebuild when you leave a Heroku Private Space?
You rebuild eight things: the isolated network, peering, the VPN, stable outbound IPs, inbound IP restrictions, internal-only apps and service discovery, space-level logging, and the private data services, plus Shield's compliance controls if you use them. Buildpacks, dynos and release phase are the regular work covered in our Heroku to AWS migration guide.
A Heroku Private Space is, in Heroku's words, a dedicated environment "for running dynos and certain types of add-ons within an isolated network" (Heroku Private Spaces). It is available only for verified Heroku Teams and Heroku Enterprise, it runs in one of 10 Private Spaces regions, and Heroku places dynos round robin across three Availability Zones.
Check your generation first. On Fir, Private Space Peering, VPN connections, Internal Routing, DNS service discovery and Shield are not available yet (Heroku Private Spaces, Private Space Peering), so a space with peering or a VPN is a Cedar space.
Start with an inventory from the Heroku CLI. Its output is the input to your AWS design:
BASH|Region, Shield on/off, and the outbound IPs your partners allowlisted
heroku spaces:info --space acme-prod --json
# CIDR ranges of the space and dyno subnets
heroku spaces:peering:info acme-prod
# Every peered AWS VPC
heroku spaces:peerings --space acme-prod
# The IPsec VPN to your office or data center
heroku spaces:vpn:connections --space acme-prod
# Inbound allowlist (Trusted IP Ranges)
heroku spaces:trusted-ips --space acme-prod
# Space-level log drain (Shield spaces)
heroku spaces:drains:get --space acme-prod
# Which apps and dynos run where
heroku spaces:topology --space acme-prod
How do Heroku Private Spaces features map to AWS, one by one?
Each Private Spaces feature maps to one or two AWS services. Three NAT gateways with Elastic IPs plus one VPN connection come to about $146 a month before data transfer, and only AWS Shield Advanced adds a large fixed line. Here is the full map, with Heroku's documented limits next to the AWS equivalent and its list price.
Heroku Private Spaces feature
What Heroku documents
AWS equivalent
AWS list price (us-east-1)
Private Space (isolated network)
Dedicated network in 1 of 10 regions, dynos across 3 AZs
VPC with private and public subnets in 3 AZs
VPC itself has no charge
Private Space Peering
Up to 5 AWS VPCs per space, 1 reserved for the data VPC; Cedar only
VPC peering, or AWS Transit Gateway for hub-and-spoke
Peering: $0.01/GB each direction across AZs. TGW: $0.05 per VPC attachment-hour plus $0.02/GB
Private Space VPN connection
1 IPsec connection per space, 2 tunnels, static routing only, IKEv1 or v2
AWS Site-to-Site VPN, static or BGP routing
$0.05 per connection-hour (about $36.50/month), plus public IPv4 on tunnel IPs
Stable outbound IPs
"A small, stable list of IP addresses dedicated to the space"; docs examples show 4
NAT gateway per AZ with an Elastic IP each
$0.045 per NAT gateway-hour plus $0.045/GB processed; $0.005 per public IPv4-hour
Trusted IP Ranges
Default 0.0.0.0/0; up to 20 ranges on Cedar, 100 on Fir
Security groups on the load balancer, or AWS WAF IP sets
Security groups free; 60 inbound rules per group by default
Internal Routing
Set only at app creation; reachable from the space, peered VPCs and VPN
Internal Application Load Balancer, or a ClusterIP Kubernetes Service
Internal ALB billed like any ALB
DNS service discovery
Dynos resolve other dynos by DNS
Route 53 private hosted zones, or Kubernetes cluster DNS
Kubernetes DNS free; Route 53 per zone
Private Space Logging (Shield)
One HTTPS syslog drain for the whole space, set only at creation
CloudWatch Logs, or Fluent Bit to your SIEM
CloudWatch per GB ingested
Private / Shield Heroku Postgres
Reachable only from dynos in the space; Private-0 from $300/month
Amazon RDS for PostgreSQL in private subnets
Instance-hour plus storage
Heroku Shield compliance
PCI DSS Level 1 AoC; HIPAA through a BAA via Heroku sales
How do you design the AWS VPC that replaces the Private Space?
Build one VPC per environment with public, private and database subnets across three Availability Zones, and pick a CIDR that overlaps nothing the old space touches. You will run both networks side by side during the cutover, so the address plan comes before any Terraform.
Heroku's default space ranges are 10.0.0.0/16, 10.1.0.0/16 and 172.17.0.0/16 (Private Space Peering). Your new VPC must avoid them and every range your peers and office use, because it will connect to the same networks as the space. I usually pick something like 10.20.0.0/16.
Public subnets: load balancers and NAT gateways only.
Private subnets: EKS worker nodes or ECS tasks, plus internal load balancers.
Database subnets: RDS and ElastiCache, with no route to the internet. I keep them separate so a security group mistake in the app tier does not expose the data.
How do I replicate Heroku Private Spaces networking (VPC peering, static IPs, Shield) on AWS?
Replace Private Space Peering with VPC peering or AWS Transit Gateway, stable outbound IPs with one NAT gateway and Elastic IP per Availability Zone, and Heroku Shield with an AWS BAA plus encryption, private databases and session logging (covered in the next section). Each subsection below covers one feature and its gotchas.
Private Space Peering becomes VPC peering or Transit Gateway
On Heroku, you request peering from your AWS VPC, Heroku accepts it with heroku spaces:peerings:accept, and you add routes and security group rules on your side. A space supports up to 5 peered VPCs, one of them reserved for the data VPC (Private Space limits).
On AWS you do the same thing without Heroku in the middle: create a peering connection from the new VPC to each peer, accept it, add routes on both sides and open the security groups. With two or three peers, plain peering is the cheapest option; you pay for data that crosses AZs at $0.01 per GB in each direction.
Move to AWS Transit Gateway once you have many VPCs, several accounts, or one VPN that several VPCs must share. A virtual private gateway attaches to only one VPC at a time, and AWS recommends a transit gateway for that case (Site-to-Site VPN quotas). Transit Gateway costs $0.05 per VPC attachment-hour plus $0.02 per GB processed, so three VPC attachments run about $110 a month before traffic.
If you peer the new VPC to the old space during the transition, route the full space /16 rather than only the dyno subnets, because apps using Internal Routing need the whole range (Internal Routing).
The Private Space VPN becomes AWS Site-to-Site VPN
Heroku's VPN is an IPsec connection with two redundant tunnels, IKEv1 or IKEv2 with a pre-shared key, static routing only, and one connection per space. Heroku states it is based on the managed AWS VPN product, so your existing customer gateway already speaks the right protocol (Private Space VPN connections).
On AWS you create a customer gateway with your office's public IP, a virtual private gateway or transit gateway, and a Site-to-Site VPN connection. You get two tunnels per connection, up to 1.25 Gbps per standard tunnel, and BGP if you want it (Site-to-Site VPN quotas). The price is $0.05 per connection-hour, about $36.50 a month, plus public IPv4 charges on the tunnel addresses and outbound data transfer beyond the free tier.
You also gain three things: more than one connection (10 per virtual private gateway by default), BGP instead of hand-maintained static routes, and database access over the VPN, which Heroku never allowed for Heroku Postgres. Build the AWS VPN in parallel with the Heroku one; your office gateway can hold both tunnel pairs as long as the CIDRs do not overlap.
Stable outbound IPs become NAT gateways with Elastic IPs
On Heroku, "all outbound traffic from apps in a Private Space originate from a small, stable list of IP addresses dedicated to the space" (Heroku Private Spaces). heroku spaces:info lists them, and the examples in Heroku's docs show four (Working with Private Spaces).
On AWS, put a NAT gateway in each public subnet, attach an Elastic IP to each, and route each private subnet's 0.0.0.0/0 to the NAT gateway in its own AZ. Three AZs give you three stable egress IPs. The cost for that setup:
The hard part is organizational. The Heroku IPs belong to Heroku and cannot be transferred to your account, so every partner who allowlisted them (payment processors, banks, customer firewalls, IP-restricted APIs) has to add your new Elastic IPs, and some take weeks. Allocate the Elastic IPs on day one, send them out with a deadline, and keep both sets allowlisted until Heroku is gone. This allowlist update is usually the item with the longest lead time, and the easiest one to leave out of the plan.
Trusted IP Ranges become security groups or AWS WAF
Trusted IP Ranges restrict which clients can reach the web processes in a space. The default is 0.0.0.0/0, Cedar allows up to 20 ranges and Fir up to 100, and the rules do not apply to internal traffic inside the space (Trusted IP Ranges, Private Space limits).
On AWS, put the same CIDRs into the inbound rules of your public load balancer's security group. A security group allows 60 inbound rules by default (Amazon VPC quotas), so a 20-range list fits, and a customer-managed prefix list helps when several load balancers share it. Behind a CDN, use an AWS WAF IP set instead, because the load balancer only sees the CDN's addresses.
Internal Routing and DNS discovery become internal load balancers and cluster DNS
Heroku apps created with --internal-routing only accept traffic from the space, peered VPCs and VPN-connected networks, and the flag can only be set at app creation (Internal Routing). On AWS, an internal Application Load Balancer in the private subnets gives the same reachability. On EKS, a ClusterIP Service and cluster DNS replace Heroku's DNS service discovery, and a Route 53 private hosted zone gives stable names to systems outside the cluster. Internal Heroku apps cannot use Automated Certificate Management; AWS Certificate Manager covers internal ALBs.
Move off Private Spaces into a VPC you own.
Qovery provisions the VPC, NAT gateways with static IPs and EKS cluster in your own AWS account, then gives your developers git-push deployments on top. Talk to a solutions architect about your Private Space inventory.
Rebuild Heroku Shield by accepting the AWS Business Associate Addendum, using only HIPAA-eligible services, encrypting with AWS KMS, keeping databases in private subnets, and logging every interactive session. AWS Shield Advanced is optional and solves DDoS protection, a different problem.
Heroku Shield is Heroku's compliance tier. Heroku holds a PCI Level 1 Service Provider Attestation of Compliance covering Shield services, and HIPAA requires a BAA added to your Heroku agreement through Heroku's sales team (Heroku compliance). AWS Shield is a DDoS service. Shield Standard is free for all AWS customers. Shield Advanced costs $3,000 a month with a one-year commitment, plus data transfer fees, and requires Business or Enterprise Support. Buy it for DDoS protection beyond Shield Standard; it does nothing for HIPAA or PCI.
Here is how each Heroku Shield control maps, based on what Heroku documents for Shield Private Spaces:
Heroku Shield control
AWS replacement
Encrypted ephemeral dyno filesystem
EBS encryption by default with an AWS KMS key you own
heroku run sessions over SSH, with every keystroke logged to the log stream
AWS Systems Manager Session Manager with session logging to S3 or CloudWatch Logs; on Kubernetes, restrict exec with RBAC and keep API audit logs
pg:psql and external Postgres connections disabled
RDS with public access off, in database subnets, reachable only from app security groups; IAM database authentication if you want it
PGBackups downloads disabled
RDS automated backups and snapshots encrypted with KMS, no public sharing; Service Control Policies to block snapshot sharing
Shield Postgres and Kafka allowed for regulated data classes
Amazon RDS and Amazon MSK, both on the AWS HIPAA-eligible services list
Space-level log drain set at creation
CloudWatch Logs or Fluent Bit to your SIEM, with retention and S3 Object Lock you control
Session Manager logs the commands and output of a session, but not sessions that go through port forwarding or SSH (Session Manager logging). If your auditor relied on Heroku's keystroke logging, block SSH and port-forwarding sessions on production nodes.
Tell your compliance team about the shift. On Heroku Shield, Salesforce carries many of the controls; on AWS, the configuration is yours, and so is the evidence (CloudTrail, KMS key policies, flow logs) in your own account.
How do you move Heroku Postgres out of a Private or Shield Space to RDS?
Move it with pg_dump and pg_restore during a short write freeze, or with an application-level incremental sync for databases too large to dump in your maintenance window. Heroku Postgres does not support logical replication today (Heroku roadmap issue #38, still in "Researching"), so AWS DMS change data capture and native Postgres subscriptions are off the table as a source.
Private-tier databases are only reachable from dynos in the same space (Heroku Postgres and Private Spaces). You have three ways to get the data out:
AWS PrivateLink from your new VPC. Supported for Private and Shield databases, not yet for Heroku Postgres Advanced. Run heroku data:privatelink:create with your AWS account ID, create a VPC endpoint in the same region, and Heroku adds a DATABASE_ENDPOINT_*_URL config var (Heroku Postgres via PrivateLink). Then pg_dump from a pod in your VPC straight into RDS. This is my default, because the dump never crosses the internet.
A one-off dyno inside the space. Run pg_dump from a one-off dyno and stream the dump to an S3 bucket you control.
Trusted IPs for Data (beta). Direct connections from outside the space through a support ticket, not available for Shield databases.
On Shield, heroku pg:psql, Dataclips and PGBackups are unavailable and non-TLS connections are rejected, so PrivateLink is the cleanest way out.
For large databases, sync incrementally as a normal Postgres user. Doctolib did this on a PaaS Postgres without replication privileges: a first dump and restore, then a loop that upserts every row whose updated_at is newer than the last sync. They report under 15 seconds of lag and a cutover window cut from more than 8 hours to under 5 minutes (Doctolib engineering). It only works if your tables never hard-delete rows.
Create the RDS instance in the database subnets with public access disabled, a KMS key you own, Multi-AZ for production and the same Postgres major version. List extensions with \dx on Heroku and confirm each is supported on RDS for that version.
What is the safest cutover sequence for a Private Space migration?
Build the network first and move the apps last: VPC and IPs, then connections, then apps in parallel, then data, then traffic, with Heroku kept warm. This order keeps a rollback path open until the final step.
Inventory (day 1). Run the heroku spaces:* commands, list every partner that allowlists your outbound IPs and every app with Internal Routing.
Allocate Elastic IPs and send them out (day 1). Partners are the slowest dependency.
Build the VPC, NAT gateways and compute (week 1). Non-overlapping CIDR, three AZs.
Recreate the connections in parallel (weeks 1-2). Same peers, same office gateway, same Trusted IP Ranges.
Deploy the apps against the Heroku database (weeks 2-3). With PrivateLink in place, staging on AWS can read the existing database.
Rehearse the database move (week 3). Time a full dump and restore into a fresh RDS instance; that sets your window.
Lower DNS TTLs to 60 seconds (48 hours before). Confirm every partner has allowlisted the new Elastic IPs.
Cut over. Maintenance mode, stop writes, finish the dump and restore or the incremental sync, point DATABASE_URL at RDS, move DNS.
Keep Heroku warm for one billing cycle. Then remove the peering, the VPN, the space, and the old IPs from partner allowlists.
Set the rollback trigger before the window: an error rate, a latency ceiling, and the person who can call it. Our minimal-downtime playbook has a ready-to-paste runbook for steps 7 to 9. Most of the calendar time goes to waiting on partners, auditors and the office network team; the AWS build itself takes days for someone who has done it before.
Which services help set up or migrate off Heroku Private Spaces to AWS?
Three kinds of providers help: AWS partners and consultancies that run the one-time migration, infrastructure-as-code you run yourself, and platforms that provision the network and cluster in your own AWS account and stay on for day-2 operations. Pick based on your bottleneck. If the lift is the problem, hire a partner. If "who runs this next year" is the problem, pick a platform or staff a platform team.
AWS runs the Migration Acceleration Program (MAP), an Assess, Mobilize, and Migrate and Modernize sequence that brings in AWS Migration Competency Partners and financial investment. Partners leave when the project ends, so someone on your side must own the result. The terraform-aws-modules VPC module builds the subnets, NAT gateways and routes above in a few dozen lines, but gives developers no deployment workflow. Qovery, Porter, Northflank (BYOC) and DuploCloud install into infrastructure you own and differ on how much Kubernetes they expose and how much day-2 work they take on.
Option
What it sets up
Who owns the AWS account
Who runs it after cutover
Developer workflow
Best fit
AWS partner via MAP
VPC, VPN, migration, controls
You
You, after handoff
Whatever they build
Large estates, funding-eligible migrations
Independent consultancy
Same, scoped per engagement
You
You, after handoff
Whatever they build
Teams with a fixed deadline
Terraform / OpenTofu modules
VPC, NAT, peering, VPN as code
You
Your platform team
None out of the box
Teams with platform engineers
Qovery
VPC, NAT gateways with static IPs, EKS cluster, RDS via Blueprints
You
Qovery manages the cluster layer; you own the account
Git push, preview environment per pull request
Teams without a dedicated DevOps engineer
Porter, Northflank BYOC, DuploCloud
Cluster and services in your cloud
You
Shared with the vendor
Git push, varies by product
Compare on your workload and compliance needs
You can combine them: a partner for the Shield controls and the data move, a platform for the workflow that replaces git push heroku.
Where does Qovery fit in a Private Spaces migration?
Qovery provisions the VPC, NAT gateways with Elastic IPs and Amazon EKS cluster inside your own AWS account, then gives developers git-push deployments and a preview environment per pull request, so you replace a Private Space without hiring a team to run Kubernetes. Qovery is an Agentic DevOps platform and never hosts your apps; they run in your account, on your AWS bill.
On a Qovery-managed EKS cluster, the Static IP / NAT gateway option (on by default for AWS) deploys NAT gateways, Elastic IPs and private subnets for fixed egress addresses. The Custom VPC subnet option lets you choose a CIDR that avoids the old space and your peers, and you can also deploy into an existing VPC you built (Qovery EKS documentation). These options are fixed at cluster creation, so decide them during the design step. Peering then follows the Qovery VPC peering guide, RDS comes in through Blueprints, and you get RBAC, audit logs and cost visibility. Qovery-managed EKS runs Kubernetes up to 1.35, with Karpenter for node autoscaling.
Qovery does not create your Site-to-Site VPN or Transit Gateway; you configure those in AWS or Terraform on the same VPC. It does not make you HIPAA or PCI compliant either. Audit logs, RBAC, region choice and your own account help you meet the controls you agree with your auditor. Cross-cloud networking is configurable with a VPN or tools such as Tailscale, and the same model works on GCP, Azure, Scaleway or an existing Kubernetes cluster. For the Heroku path, see Heroku to AWS with Qovery.
How do I run this migration with Qovery from Claude Code or Cursor?
Install the Qovery Agent Skills and your coding agent can create the cluster, deploy each app and wire a managed database into your own AWS account, with your approval at every step. The Qovery MCP Server operates what already exists and is read-only by default.
Install the skills globally (Claude Code, Cursor, Codex, OpenCode, Gemini CLI and others), or for one project:
Add the Qovery MCP Server to Claude Code. It signs in with OAuth and starts read-only:
BASH
claude mcp add --transport http qovery https://mcp.qovery.com/mcp --callback-port 4242
Enable write access only when you want the agent to change things. It also needs write access turned on in the Qovery Console:
BASH
claude mcp add --transport http qovery "https://mcp.qovery.com/mcp?read_write=true" --callback-port 4242
The skills include qovery-onboard, qovery-deploy, qovery-troubleshoot, qovery-optimize, qovery-speedup, qovery-preview and qovery-terraform. Paste your inventory and ask: "Here is my Heroku Private Space inventory. Set up a Qovery cluster on my AWS account with static outbound IPs and a VPC CIDR that does not overlap 10.0.0.0/16, 10.1.0.0/16 or 172.17.0.0/16, then deploy these apps with a managed PostgreSQL." The VPN and Transit Gateway stay with you or your Terraform.
Which services help set up or migrate off Heroku Private Spaces to AWS?
AWS Migration Competency Partners (often through the AWS Migration Acceleration Program) and independent consultancies run the one-time migration. Terraform or OpenTofu modules build the VPC if you have platform engineers. Platforms such as Qovery, Porter, Northflank BYOC and DuploCloud provision infrastructure in your own AWS account and stay for day-2 operations.
How do I replicate Heroku Private Spaces networking (VPC peering, static IPs, Shield) on AWS?
Build a three-AZ VPC with a CIDR that avoids 10.0.0.0/16, 10.1.0.0/16 and 172.17.0.0/16. Use VPC peering or AWS Transit Gateway for peering, one NAT gateway and Elastic IP per AZ for static IPs, and security groups or AWS WAF for Trusted IP Ranges. Replace Heroku Shield with an AWS BAA, KMS encryption, private RDS and Session Manager logging.
Can I keep my Heroku Private Space outbound IP addresses when I move to AWS?
No. The stable outbound IPs belong to Heroku and cannot be transferred to your AWS account. Allocate Elastic IPs for your NAT gateways at the start, send them to every partner that allowlists you, and keep both sets until the space is destroyed.
Is Heroku Shield the same as AWS Shield?
No, they are unrelated products. Heroku Shield is a compliance tier with a PCI DSS Level 1 attestation and HIPAA support through a BAA. AWS Shield is DDoS protection: Shield Standard is free, and Shield Advanced costs $3,000 per month with a one-year commitment plus data transfer fees.
How do I migrate a Shield or Private Heroku Postgres database to Amazon RDS?
Use pg_dump and pg_restore during a short write freeze, because Heroku Postgres does not support logical replication. For Shield databases, where pg:psql and PGBackups are disabled, dump through an AWS PrivateLink endpoint in your new VPC. For very large databases, an incremental sync on updated_at shortens the freeze if rows are never hard-deleted.
What does the Private Spaces networking layer cost on AWS?
In us-east-1, three NAT gateways cost about $98.55 a month plus $0.045 per GB processed, three Elastic IPs about $10.95, and one Site-to-Site VPN about $36.50. Peering adds $0.01 per GB each way across AZs, Transit Gateway $0.05 per attachment-hour plus $0.02 per GB, and Shield Advanced $3,000 a month if you buy it.
Guillaume is a Staff Solutions Architect at Qovery. He helps customers troubleshoot production infrastructure and writes about Kubernetes operations, AI agents, and reliable cloud platforms.
Next step
Move off Private Spaces into a VPC you own.
Qovery provisions the VPC, NAT gateways with static IPs and EKS cluster in your own AWS account, then gives your developers git-push deployments on top. Talk to a solutions architect about your Private Space inventory.