Two accounts need private access to each other's APIs, with overlapping CIDRs. What do you build?
AdvancedScenarioIAM, Organizations and Multi-Account
Answer
Situation read → Overlapping CIDRs rule out VPC peering and Transit Gateway routing, so expose services rather than networks.
What I'd do →
- In the provider account put the service behind an NLB and create a VPC endpoint service with
aws ec2 create-vpc-endpoint-service-configuration --network-load-balancer-arns ... - Whitelist the consumer account principal and require acceptance
- In the consumer account create an interface endpoint to the service name
- Consumer calls the endpoint's private DNS name, unaffected by CIDR overlap
Why → PrivateLink is one-directional and NAT-less at the packet level, so address overlap never matters.
Interview tip → Contrast: peering and TGW share routes, PrivateLink shares a service.
More on IAM, Organizations and Multi-Account
A developer needs read-only access to one S3 bucket from their laptop. How do you grant it without creating long-lived access keys?BeginnerAn EC2 application needs to write to DynamoDB. Where do the credentials come from?BeginnerSecurity wants to know who deleted a production S3 bucket yesterday. How do you find out?BeginnerYou must stop anyone in a member account from disabling CloudTrail, even account admins. What do you use?BeginnerA cross-account role assumption fails with AccessDenied even though the target role trusts the source account. What do you check?IntermediateDesign access for a CI pipeline in GitHub Actions to deploy to AWS without storing AWS keys in GitHub.Intermediate