Lab 05: The Hostname That Existed In Only One VPC
A peered VPC cannot resolve an internal service name. The peering is active, routes exist both ways, security groups permit the port, and connecting by IP address works perfectly. The record is present and correct in the private hosted zone.
- Debugging time
- ~30 min
- Reading time
- 11 min
- Reported by
- Data Platform
- Tier
- Specialty
Reporting service cannot resolve db.svc.internal after migration to its own VPC
Reported by Data Platform
The reporting service moved out of the shared VPC into its own account-level VPC last night.
Everything about the move looked clean. The VPC peering connection is active, routes were added in
both directions, and the database security group already permits the new CIDR on 5432.
The service will not start. It fails at connection setup with a name resolution error, not a timeout — so it never gets as far as the network. A developer confirmed she can reach the database by IP address from the new VPC without any problem.
Nobody has changed the hosted zone. The record is there; she checked it in the console.
What you are working with
Two VPCs, peered, in a single Availability Zone.
Each route table carries the other VPC's CIDR at the peering connection, so packets cross in both directions. The data security group admits 5432 from 10.30.0.0/16, which is the app VPC exactly. Every object on this diagram is correct — and the thing the application actually needs is not drawn here at all, because it is not part of the packet path.
- EC2
Reporting host (app VPC)
10.30.1.x — resolving db.svc.internal
- RTB
Route 53 Resolver, app VPC
10.30.0.2 — answers for zones associated with THIS VPC
Dropped — svc.internal is not associated with the app VPC, so the Resolver has no record to return and falls through to public DNS, which has no .internal
- GW
VPC peering
active, routed both ways — never reached
- DEST
Database host (data VPC)
10.31.1.x:5432 — listening and reachable by IP
The failure happens at the first hop, before any packet is addressed to the database. Everything downstream is healthy, which is why every network-level check passes.
| Resource | Configuration |
|---|---|
| App VPC | 10.30.0.0/16, DNS support and hostnames both enabled |
| Data VPC | 10.31.0.0/16, DNS support and hostnames both enabled |
| Peering | active, 10.31.0.0/16 routed from app, 10.30.0.0/16 routed from data |
| Private hosted zone | svc.internal, containing db.svc.internal → 10.31.1.x |
sg-data | Inbound 5432 from 10.30.0.0/16 |
sg-app | All outbound |
Both instances sit in public subnets with an internet gateway, purely so dig and nc install at
launch. That has no bearing on the failure.
Scope and constraints
- In scope: DNS resolution from the application VPC.
- Out of scope: the database itself, the peering connection, security groups, and route tables. All four are correctly configured and you should be able to prove it quickly.
enable_dns_supportandenable_dns_hostnamesare on for both VPCs. This is not that bug.- The record exists and its value is correct. This is not a missing-record bug.
- Reaching for a Route 53 Resolver endpoint is the expensive wrong answer here. Part of the exercise is being able to say why.
Deploy the broken state
cd lab-05-private-zone-association
terraform init
terraform apply
# Shell on the reporting host
aws ssm start-session --target "$(terraform output -raw app_instance_id)"
# The values you will need
terraform output service_fqdn
terraform output data_private_ip
terraform output app_vpc_id
terraform output hosted_zone_idAllow a minute after apply for user_data to install the tooling and start the listener.
The rest of this lab is part of Labs Pro
The reproduction steps, the deployable Terraform, and the debrief with root cause and remediation diff for this lab are available to Labs Pro members. One payment of $49, no subscription, and it covers every Pro lab now and later.
The incident brief is open, so you can see what you would be solving before you decide.
Already bought it? Sign in and it unlocks.
The rest of this lab is part of Labs Pro
The reproduction steps, the deployable Terraform, and the debrief with root cause and remediation diff for this lab are available to Labs Pro members. One payment of $49, no subscription, and it covers every Pro lab now and later.
The incident brief is open, so you can see what you would be solving before you decide.
Already bought it? Sign in and it unlocks.