Multiple AWS Accounts
If you are wanting to locate services in the same Availability Zone from different AWS accounts, you will need to determine how each account names each Availability Zone.
From Regions and Availability Zones:
An Availability Zone is represented by a region code followed by a letter identifier; for example, us-east-1a
. To ensure that resources are distributed across the Availability Zones for a region, we independently map Availability Zones to identifiers for each account. For example, your Availability Zone us-east-1a
might not be the same location as us-east-1a
for another account. There's no way for you to coordinate Availability Zones between accounts.
Well, actually there is a way to coordinate it. There are two ways to determine AZ mapping between AWS accounts:
- Contact AWS Support and ask which zones map to each other between the accounts, or
- Look at Spot Pricing
Spot Pricing is per-AZ, so if you look at prices for Spot Instances in each account, you'll be able to figure out which AZs map to each other. Just pick an instance type and look for the same-shaped graph!
Guaranteeing traffic doesn't go over the Internet
If you refer to instances via the private IP address, then traffic will never go over the Internet. If your instances are in different AWS accounts and/or different VPCs, you can use VPC Peering to connect the VPCs together (even between different accounts). Then you can route traffic via private IP addresses and no traffic will flow over the Internet.
Rules for VPC Peering:
- Same region
- Non-overlapping IP addresses ranges
- Can be from different AWS accounts